美文网首页
TableView 去掉多余行数、IOS最后一行Cell系统分

TableView 去掉多余行数、IOS最后一行Cell系统分

作者: wintersal | 来源:发表于2016-03-26 15:19 被阅读243次

//去掉底部多余的表格线

[tableViewsetTableFooterView:[[UIViewalloc]initWithFrame:CGRectZero]];

//最后一行分隔线顶头显示

//http://stackoverflow.com/questions/25770119/ios-8-uitableview-separator-inset-0-not-working

staticvoidsetLastCellSeperatorToLeft(UITableViewCell* cell)

{

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

[cellsetSeparatorInset:UIEdgeInsetsZero];

}

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

[cellsetLayoutMargins:UIEdgeInsetsZero];

}

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

[cellsetPreservesSuperviewLayoutMargins:NO];

}

}

相关文章

网友评论

      本文标题:TableView 去掉多余行数、IOS最后一行Cell系统分

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