简体   繁体   中英

[iPhone]How to set padding of grouped tableview section?

Hi I have a grouped tableview and i need to change the padding of sections.I need to have between 2 sections 10px. I have tried to dissmiss header like that:

    CGRect frame = [myTableView rectForFooterInSection:indexPath.section];
    frame.size.height = 0;

    CGRect frame1 = [myTableView rectForHeaderInSection:indexPath.section];
    frame1.size.height = 0;

But it does not work. Can i change the padding.If you want some example i find:Add event in calendar on iPhone

thanks

Those frames are not pointers, when you change them the original rect isn't affected. They are stored separately in memory.

It seems like the tableView:heightForHeaderInSection: UITableView delegate is what you are after. You can find more info here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM