查什么东西都他妈的要翻*—^^—*墙, 国内的都好渣,把这贴一下
数据不满的时候UITableView会有很多空线,数据加载之前也会有很多横线,去掉的办法就是给他的footer设置一下:
引用
For iOS 8., 7. and iOS 6.1
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.
For previous versions
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
分享到:
相关推荐
UITableView、UITableView基本用法、UITableView详解,UITabelView常用方法
UITableView相关操作
UITableView Cache - UITableView 缓存
UITableView教材 IPHONE IPAD
UITableView用来以表格的形式显示数据。关于UITableView,我们应该注意: (1)UITableView用来显示表格的可见部分,UITableViewCell用来显示表格的一行。 (2)UITableView并不负责存储表格中的数据,而是仅仅存储...
IOS UITableView UIcollectionView 结合
UITableView 详细讲解
UITableView通过重用单元格来达到节省内存的目的:通过为每个单元格指定一个重用标识符 reuseIdentifier 即指定了单元格的种类 以及当单元格滚出屏幕时 允许恢复单元格以便重用 对于不同种类的单元格使用不同的ID ...
UITableView 缩进 附属视图 Cell Demo
UITableView 三级菜单
iOS UITableView查询及索引UISEARCHBAR
这是iPhone之UITableView入门的示例程序,具体参考: http://blog.csdn.net/htttw/article/details/7875462
UITableView的SectionHeader的复用,UITableView的SectionHeader的复用
UITableview处理键盘遮挡 没有实现控件复用导致的出现重复文本,以及部分bug。
UITableView的简单使用
UICollectionView,UITableView用法,UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
UITableView 删除 Cell Demo Delete
UITableView 简单例子,显示两个表区域,然后点击每行弹出一个提示框,有代码注释
UITableView Demo UITableCell 代码 表格