I have added a UIButton
in the header section of the UITableView
via the interface builder and would like to remove the access to the button in certain cases. I have tried to use the .hidden = TRUE
property but it just hides the button from the view, leaving a white space behind. How do I programmatically remove the header of UITableView
and have the table's content automatically resizes to fill in the removed header area?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
If you want to remove the table's header view, just set the myTable.tableHeaderView property to nil. If what you have is actually a section header, then you need to return nil from the viewForHeaderInSection method and call [myTableView reloadData]
You could also do:
This seems to work for my (single) section header and avoids the need for
reloadData
.Note that:
is still called, but its return value seems to be ignored.
I created a boolean property called
removeHeader
and then when ever I want to remove my header I call:Then when my tableView reloads it will call this tableView delegate method: