方法1: tableview.separatorStyle = UITableViewCellSeparatorStyleNone;然后自定义cell的分割线
方法2: 设置cell的separatorInset cell.separatorInset = UIEdgeInsetsMake(0, MAXFLOAT, 0,0);不显示
当分组情况下,去除分组间的线
设置tableview的style为UITableViewStylePlain
去除头部黏合
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 10;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
本文介绍两种去除UITableView中cell分割线的方法:一是通过设置tableview.separatorStyle为UITableViewCellSeparatorStyleNone并自定义cell的分割线;二是调整cell的separatorInset来隐藏分割线。此外,还提供了去除分组间线条和头部黏合的实现方式。
1148

被折叠的 条评论
为什么被折叠?



