您的位置:首页 > 移动开发 > IOS开发

ios tableviewcell分割线左边有空白

2015-07-10 11:20 232 查看
上网搜了下资料,貌似从ios7开始tableviewcell的分割线左边都有空白,解决方法:

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

[self.mytableview setSeparatorInset:UIEdgeInsetsZero];

}

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

[self.mytableview setLayoutMargins:UIEdgeInsetsZero];

}

}

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{

if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

[cell setLayoutMargins:UIEdgeInsetsZero];

}

if ([cell respondsToSelector:@selector(setSeparatorInset:)]){

[cell setSeparatorInset:UIEdgeInsetsZero];

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: