美文网首页
解决tableView左侧有一小段空缺,显示不全

解决tableView左侧有一小段空缺,显示不全

作者: 恋家的人走不丢 | 来源:发表于2017-12-06 17:55 被阅读0次

//解决tableview分割线左边显示不全

-(void)viewDidLayoutSubviews {

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

[self.tableViewsetSeparatorInset:UIEdgeInsetsZero];

}

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

[self.tableViewsetLayoutMargins:UIEdgeInsetsZero];

}

}

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

if([cellrespondsToSelector:@selector(setLayoutMargins:)]) {

[cellsetLayoutMargins:UIEdgeInsetsZero];

}

if([cellrespondsToSelector:@selector(setSeparatorInset:)]){

[cellsetSeparatorInset:UIEdgeInsetsZero];

}

}

相关文章

网友评论

      本文标题:解决tableView左侧有一小段空缺,显示不全

      本文链接:https://www.haomeiwen.com/subject/ayylixtx.html