How to hide a section in UITableView?

前端 未结 12 2223
梦如初夏
梦如初夏 2020-12-05 00:32

There are some section in the table that does not contain any data and would like to hide that section.

How to do this?

12条回答
  •  醉酒成梦
    2020-12-05 00:56

    I disagree with Tim. We have a way to access any section/row of a table from anywhere in our code and change its .hidden property (and all other properties).

    This is the way I usually use:

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:2];
    [self.SeymourCakesTableView cellForRowAtIndexPath:indexPath].hidden = YES;
    

提交回复
热议问题