iOS7 tableview separatorInset cell分割线左对齐

在iOS7中,表格中经常看到的一个情况是如下所示,

iOS7 tableview separatorInset cell分割线左对齐_第1张图片

解决方法: 1,手写代码控制1 self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);  

但是在iOS7之前是没有这个设置,所以要加下判断。以免程序在iOS7之前的环境下运行崩溃。

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {

self.tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);

}

2,nib,通过下图把Separator Insets的模式改为Custom,并且把Left的15改为0 转载请注明:天狐博客 » iOS7 tableview separatorInset cell分割线左对齐

iOS7 tableview separatorInset cell分割线左对齐_第2张图片

你可能感兴趣的:(ios开发,ios7)