为了解决tableview 左侧少15px 分隔线

This commit is contained in:
life
2015-11-06 10:56:53 +08:00
parent e53b2b99bb
commit 8dd35aed3d
4 changed files with 29 additions and 1 deletions

View File

@@ -152,6 +152,15 @@ NSString const *key = @"isSelectOnSearchKey";
[WPStyleGuide configureColorsForView:self.view andTableView:tableView];
// footer线,
tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 44.0)]; // add some vertical padding
// 15px 线
if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[tableView setLayoutMargins:UIEdgeInsetsZero];
}
}
-(UIView *) iniNoResultView:(UITableView *) tableView
@@ -181,4 +190,16 @@ NSString const *key = @"isSelectOnSearchKey";
return nomatchesView;
}
// 线15px, iphone, ipad
-(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];
}
}
@end