UITableView UITableViewStylePlain UITableViewStyleGrouped

一。如何选择grouped Or Plain

1.grouped的sectionHeader,sectionFooter的背景色默认跟tableview的背景色一样。plain反之

2.grouped的sectionHeader不会悬浮。plain反之。

3.plain会出现多余的分割线,grouped不会。

4.grouped某一行的上线边缘默认会有分割线。

5.优先使用grouped。

6.不管使用那种类型,不建议使用_tableView.sectionHeaderHeight =1; _tableView.sectionFooterHeight =50这种来定义sectionView高度,建议实现代理方法。因为有的时候grouped好像不起效果。


UITableViewStylePlain 类型时,

解决多余分割线问题,

 UIView *v = [[UIView allocinitWithFrame:CGRectMake(0,0,CGRectGetWidth(self.view.bounds),0)];

        _tableView.tableFooterView = v;

解决默认sectionHeader sectionFooter颜色问题

- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {

    view.tintColor = [NWUtility colorWithHex:0xF0F0F0];

}

UITableViewStyleGrouped类型时:不会出现多余分割线问题,所以不用设置tableFootView.




UITableViewStylePlain滑动时才会有section停留效果,UITableViewStyleGrouped没有。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值