开发者

How to change how table sections display themselves?

开发者 https://www.devze.com 2023-01-19 23:49 出处:网络
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 tho

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

精彩评论

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