UITableViewCell分组圆角
2022-04-27 本文已影响0人
爱喝酸奶的小龙
iOS13 UITableView增加了分组样式UITableViewStyleInsetGrouped 效果如图所示:
需要注意的是这里需要设置预估行高 self.tableView.estimatedSectionHeaderHeight = 0; self.tableView.estimatedSectionFooterHeight = 0;不然分组高度不会生效。
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ return 0.01f; }
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{ return kScaleWidth(10); }
![](https://img.haomeiwen.com/i8610772/96e3b482f307c2bd.png)
![](https://img.haomeiwen.com/i8610772/24ac47aefc6664fb.png)
如果需要支持iOS13之前可以参考这里