转自iOS_愛OS的TableView 去掉多余行数、IOS最后一行Cell系统分割线顶格http://www.jianshu.com/p/1290f6aa1774
-
tableView分割线顶格
使用方法:cellForRow中调用 setLastCellSeperatorToLeft(cell);
// tableView分割线顶
static void setLastCellSeperatorToLeft(UITableViewCell* cell)
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { [cell setLayoutMargins:UIEdgeInsetsZero]; } if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){ [cell setPreservesSuperviewLayoutMargins:NO]; } }
tableView去掉多余的分割线
//去掉多余的表格线
[self.tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];