查什么东西都他妈的要翻*—^^—*墙, 国内的都好渣,把这贴一下
数据不满的时候UITableView会有很多空线,数据加载之前也会有很多横线,去掉的办法就是给他的footer设置一下:
[quote]
[b]For iOS 8., 7. and iOS 6.1[/b]
The easiest method is to set the tableFooterView property:
Or using Storyboard, drag a View to the bottom of the Table View to create a tableFooterView. Set the frame of the tableFooterView to have a height of 0.
[b]For previous versions[/b]
You could add this to your TableViewController (this will work for any number of sections):
and if it is not enough, add the following code too:
share|improve this an
[/quote]
数据不满的时候UITableView会有很多空线,数据加载之前也会有很多横线,去掉的办法就是给他的footer设置一下:
[quote]
[b]For iOS 8., 7. and iOS 6.1[/b]
The easiest method is to set the tableFooterView property:
- (void)viewDidLoad {
[super viewDidLoad]; // This will remove extra separators from tableview
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
}
Or using Storyboard, drag a View to the bottom of the Table View to create a tableFooterView. Set the frame of the tableFooterView to have a height of 0.
[b]For previous versions[/b]
You could add this to your TableViewController (this will work for any number of sections):
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
// This will create a "invisible" footer
return 0.01f;
}
and if it is not enough, add the following code too:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
// If you are not using ARC:
// return [[UIView new] autorelease];
}
share|improve this an
[/quote]