mirror of
https://github.com/leanote/leanote-ios.git
synced 2025-10-18 09:25:02 +00:00
为了解决tableview 左侧少15px 分隔线
This commit is contained in:
@@ -152,6 +152,15 @@ NSString const *key = @"isSelectOnSearchKey";
|
|||||||
[WPStyleGuide configureColorsForView:self.view andTableView:tableView];
|
[WPStyleGuide configureColorsForView:self.view andTableView:tableView];
|
||||||
// footer不要有分割线, 防止断片
|
// footer不要有分割线, 防止断片
|
||||||
tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 44.0)]; // add some vertical padding
|
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
|
-(UIView *) iniNoResultView:(UITableView *) tableView
|
||||||
@@ -181,4 +190,16 @@ NSString const *key = @"isSelectOnSearchKey";
|
|||||||
return nomatchesView;
|
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
|
@end
|
||||||
|
@@ -155,8 +155,9 @@
|
|||||||
// 放这里
|
// 放这里
|
||||||
[self.tableView reloadData];
|
[self.tableView reloadData];
|
||||||
|
|
||||||
// table的样式
|
// table的样式, 包括search table view
|
||||||
[self setTableStyle:self.tableView];
|
[self setTableStyle:self.tableView];
|
||||||
|
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
|
||||||
|
|
||||||
// isBlog ?
|
// isBlog ?
|
||||||
if(self.isBlog) {
|
if(self.isBlog) {
|
||||||
@@ -405,6 +406,7 @@
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 每行显示什么
|
// 每行显示什么
|
||||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
@@ -418,6 +420,9 @@
|
|||||||
// configure the cell
|
// configure the cell
|
||||||
Note *note = [fetched objectAtIndexPath:indexPath];
|
Note *note = [fetched objectAtIndexPath:indexPath];
|
||||||
|
|
||||||
|
[self.searchDisplayController.searchResultsTableView setSeparatorInset:UIEdgeInsetsZero];
|
||||||
|
[self.searchDisplayController.searchResultsTableView setLayoutMargins:UIEdgeInsetsZero];
|
||||||
|
|
||||||
static NSString *cellIdentifier2 = @"NoteCell2";
|
static NSString *cellIdentifier2 = @"NoteCell2";
|
||||||
NoteCell *cell2 = [tableView dequeueReusableCellWithIdentifier:cellIdentifier2];
|
NoteCell *cell2 = [tableView dequeueReusableCellWithIdentifier:cellIdentifier2];
|
||||||
if (cell2 == nil) {
|
if (cell2 == nil) {
|
||||||
|
@@ -112,6 +112,7 @@
|
|||||||
|
|
||||||
// table的样式
|
// table的样式
|
||||||
[self setTableStyle:self.tableView];
|
[self setTableStyle:self.tableView];
|
||||||
|
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
|
||||||
|
|
||||||
// cate
|
// cate
|
||||||
if(self.delegate) {
|
if(self.delegate) {
|
||||||
|
@@ -108,6 +108,7 @@
|
|||||||
|
|
||||||
// table的样式
|
// table的样式
|
||||||
[self setTableStyle:self.tableView];
|
[self setTableStyle:self.tableView];
|
||||||
|
[self setTableStyle:self.searchDisplayController.searchResultsTableView];
|
||||||
|
|
||||||
// cate
|
// cate
|
||||||
if(self.delegate) {
|
if(self.delegate) {
|
||||||
|
Reference in New Issue
Block a user