您的位置:首页 > 其它

设置table分割线靠左边0距离对齐

2015-09-01 17:46 211 查看
在viewDidload 加下面代码
if ([self.table respondsToSelector:@selector(setSeparatorInset:)]) {

[self.table setSeparatorInset:UIEdgeInsetsZero];

}

if ([self.table respondsToSelector:@selector(setLayoutMargins:)]) {

[self.table setLayoutMargins:UIEdgeInsetsZero];

}


实现方法
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

{

if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {

[cell setSeparatorInset:UIEdgeInsetsZero];

}

if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

[cell setLayoutMargins:UIEdgeInsetsZero];

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: