
如果什么都不设置的话 分割线是从cell.textlabel处开始的
如果加上
[_myTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
分割线是从cell.imageView.image处开始的
如果想从顶端开始加入下列代码就OK了。。。具体原因本菜鸟也不清楚
-(void)viewDidLayoutSubviews
{
if ([self.myTableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.myTableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)];
}
if ([self.myTableView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.myTableView 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];
}
}