最新消息:iOS编程开发交流群(6906921) ,Mac.Cocoa开发交流群(7758675) 欢迎iOS/macOS开发编程爱好及学习者加入!

iOS7 tableview separatorInset cell分割线左对齐

iOS 天狐 21408浏览 1评论
在iOS7中,表格中经常看到的一个情况是如下所示,

解决方法:

1,手写代码控制

 

2,nib,通过下图把Separator Insets的模式改为Custom,并且把Left的15改为0

 ===========================================
IOS8最新设置方法

方法2:

使用UIAppearance,在程序开始的时候设置全局默认外观,不错的方法

 

转载请注明:天狐博客 » iOS7 tableview separatorInset cell分割线左对齐

微信 OR 支付宝 扫描二维码
为天狐 打赏
非常感谢你的支持,哥会继续努力!
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. 此方法在IOS8下不管用了,ios8需要这样处理: -(void)viewDidLayoutSubviews { [self.tableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)]; [self.tableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)]; } -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ [cell setLayoutMargins:UIEdgeInsetsZero]; [cell setSeparatorInset:UIEdgeInsetsZero]; }
    弗丁10年前 (2014-11-08)回复