You can set it as tableHeaderView, for example:
UITableView *tv = ...;
tv.tableHeaderView = yourView;
or using Interface Builder, even easier.
Read the documentation UITableViewDataSourceand UITableViewDelegateto find out more about these features:
-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
-(UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section
Then you should return UIViewfor the section. (remember autoreleasethem if they are not statically allocated!)
source
share