1、设置cell离左边视图的距离
tempTableView.separatorInset=UIEdgeInsetsMake(0, 20, 0, 0);//距离左侧20pt
2、设置tableview 没有分割线
tempTableView.separatorStyle= UITableViewCellSeparatorStyleNone
3、table为group类型时,消除顶部一段间隔
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section{
return0.1;
}
-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section{
return [[UIView alloc] initWithFrame:CGRectZero];
}
4、设置cell 下行线的左侧边距为零
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if([cellrespondsToSelector:@selector(setSeparatorInset:)]) {
[cellsetSeparatorInset:UIEdgeInsetsZero];
}
}
网友评论