为了解决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

View File

@@ -155,8 +155,9 @@
//
[self.tableView reloadData];
// table
// table, search table view
[self setTableStyle:self.tableView];
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
// isBlog ?
if(self.isBlog) {
@@ -405,6 +406,7 @@
return count;
}
//
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
@@ -418,6 +420,9 @@
// configure the cell
Note *note = [fetched objectAtIndexPath:indexPath];
[self.searchDisplayController.searchResultsTableView setSeparatorInset:UIEdgeInsetsZero];
[self.searchDisplayController.searchResultsTableView setLayoutMargins:UIEdgeInsetsZero];
static NSString *cellIdentifier2 = @"NoteCell2";
NoteCell *cell2 = [tableView dequeueReusableCellWithIdentifier:cellIdentifier2];
if (cell2 == nil) {

View File

@@ -112,6 +112,7 @@
// table
[self setTableStyle:self.tableView];
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
// cate
if(self.delegate) {

View File

@@ -108,6 +108,7 @@
// table
[self setTableStyle:self.tableView];
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
// cate
if(self.delegate) {