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); }

如果需要支持iOS13之前可以参考这里

上一篇 下一篇

猜你喜欢

热点阅读