首页 > iOS UITableView 实现去除Section的分割线,保留Cell的分割线

iOS UITableView 实现去除Section的分割线,保留Cell的分割线


我用iOS8 SDK,默认就是你需要的效果:


首先我觉得你要先把背景颜色设置好,这样你不会把section的分割线或者tableview的背景颜色混淆
通常我们在做自定义的cell或者section header and footer,我们尽量用一个高度为1-3point的view来代替,这样我的话我们就有更多可以操控的空间。就是我们通常说的障眼法
如果你还解决不了最好发代码上来


+ (void)hideEmptySeparators:(UITableView *)tableView
{
  UIView *v = [[UIView alloc] initWithFrame:CGRectZero];
 [tableView setTableFooterView:v];
}

lz 你试试在viewDidLoad 的时候调用这段代码?


tableview 改成 plain

【热门文章】
【热门文章】