I want to display 开发者_高级运维the sections in a UITableView different from the built-in behaviour, with images as the section header and footer. What is the best way of achieving this?
implement those UITableView-delegate methods:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
You can even mix custom and standard headers, if you return nil in tableView:viewForHeaderInSection: the tableView will use the standard section title if you provide one.
精彩评论