ios8中左对齐代码
//加入如下代码
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
} if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
} if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
ios7中左对齐代码
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= ) {
self.tableView.separatorInset = UIEdgeInsetsMake(, , , );
}
如果在ios7中使用nib或者storyboard可通过下图把Separator Insets的模式改为Custom,并且把Left的15改为0 转载请注明:天狐博客 » iOS7 tableview separatorInset cell分割线左对齐
以上内容分别引用 http://blog.sina.com.cn/s/blog_5da93c8f0101qgdz.html http://roybaby.blog.51cto.com/1508945/1558182