开发者

How to change how table sections display themselves?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜