IOS7以上设置TableviewCell分割线左端开始

-(void)viewDidLayoutSubviews

{

if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {

[self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];

}

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

[self.tableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)];

}

}

-(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];

}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1、禁止手机睡眠[UIApplication sharedApplication].idleTimerDisabl...
    DingGa阅读 1,143评论 1 6
  • 版权声明:未经本人允许,禁止转载. iOS 7之后,tableView的分割线左边距默认设置为15,如图 iOS ...
    萧雪痕阅读 4,323评论 0 6
  • 同行一个月赚了66万,我问他是怎么做到的? 他说天天没业绩被领导打断腿 保险赔的。。。 我的问题总结: 第一,最...
    古墓道人阅读 357评论 0 1
  • 以下内容比较旧了,可以来看这篇 链接:https://www.smashingmagazine.com/2016/...
    buershero阅读 657评论 0 0
  • 又一天过去了,作为一名普通三本大学的我逐渐被所谓的生活打倒了。在刚刚过去的双十一里,我还是向马云爸爸低了头,后果就...
    没有驯鹿的理想阅读 186评论 0 1