Removing cell borders from a section of grouped-style UITableView

后端 未结 15 2152
南旧
南旧 2020-12-04 07:56

I have a UITableViewController initialized with the grouped style and having multiple sections. For one of these sections, I\'d like its constituent cells to be completely t

15条回答
  •  孤街浪徒
    2020-12-04 08:23

    NOTE: This doesn't appear to be working in iOS7 and above. For iOS7 try this answer.

    For iOS6 and below, to remove the grouped background from a cell in a grouped table view cell:

    This didn't work

    cell.backgroundView = nil; // Did Not Work
    

    This did

    cell.backgroundView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
    

    If you have moved to ARC (I've heard this works, but haven't tested it)

    cell.backgroundView = [UIView new];
    

提交回复
热议问题