美文网首页UITableView相关学习点
去除UITableView分割线左侧的距离

去除UITableView分割线左侧的距离

作者: FengxinLi | 来源:发表于2016-06-06 17:37 被阅读55次

设置属性

[tabelview setSeparatorInset:UIEdgeInsetsZero];

[tabelview 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];

}

}

相关文章

网友评论

    本文标题:去除UITableView分割线左侧的距离

    本文链接:https://www.haomeiwen.com/subject/rhqddttx.html