Setting a base footer in a UITableView

How is the base footer set in a UITableView programmatically?

Just centered text?

EDIT:

How to set the border color and position of the footer at the bottom of the screen, or if your thumbs do not fill the screen, the footer is not above the bottom of the screen.

enter image description here

+7
source share
2 answers

You can use the UITableViewDataSource callback (text only):

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section 

Or UITableViewDelegate (any custom view you like):

 - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
+8
source

viewForFooterInSection sets the section footer. To set the table footer, you want to set

 self.tableView.tableFooterView = myCustomFooterView 

where myCustomFooterView is what you are setting up elsewhere. You probably set this to viewDidLoad.

+10
source

All Articles