博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iOS 双击状态栏滚到视图顶部无效
阅读量:2432 次
发布时间:2019-05-10

本文共 1210 字,大约阅读时间需要 4 分钟。

在我的项目中有一个界面有两个tableView, 其它的像scrollView, collectionView都没有, 设置好了相应的scrollsToTop怎么都无效.

这是我的代码

_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 45 * ScaleHeight, Width, Height - 64 - 45 * ScaleHeight) style:UITableViewStylePlain];    _tableView.delegate = self;    _tableView.dataSource = self;    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;    _tableView.backgroundColor = [UIColor colorWithRed:0.94 green:0.95 blue:0.95 alpha:1.00];    _tableView.scrollsToTop = YES;    [self.view addSubview:_tableView];    _tableView.tableFooterView = [[UITableView alloc] init]; // 注意这句话
_screenTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, _screenView.frame.size.width, Height - 20 - 40 * ScaleHeight) style:UITableViewStylePlain];    _screenTableView.delegate = self;    _screenTableView.dataSource = self;    _screenTableView.scrollsToTop = NO;    _screenTableView.separatorStyle = UITableViewCellSeparatorStyleNone;    [_screenView addSubview:_screenTableView];
怎么设置也不好使, 就是我要放弃的时候我删除了"
_tableView.tableFooterView = [[UITableView alloc] init]; // 注意这句话
"这段代码, 一开始为了去除底部的横线加了那句话, 后来用自定义cell那句话就没用了.

解决办法: 

_tableView.tableFooterView = [[UITableView alloc] init];
将这段代码删除.

转载地址:http://sntmb.baihongyu.com/

你可能感兴趣的文章
SQL Server CE 开发前准备(转)
查看>>
多角度详解网站安全保护方法(转)
查看>>
Microsoft .NET Framework 精简版多线程提示(转)
查看>>
客户端访问Web Service方法的一个细节(转)
查看>>
SQL Server和Access、Excel数据传输(转)
查看>>
只读更新全程图解教程(转)
查看>>
关于 cleanup stack 和 two phase consturction [1](转)
查看>>
Oracle数据导入导出imp/exp (转)
查看>>
如何构建固定网(PSTN)短消息系统(转)
查看>>
Delphi文件管理(三)(转)
查看>>
关于网线的一些问题的解答(转)
查看>>
深度分析Win 2003自动升级补丁功能(转)
查看>>
使用Carbide.vs与VS.NET2003构建Symbian开发平台-S60 平台(转)
查看>>
来访者地址统计,很好的一个程序!(转)
查看>>
UpdateWindow函数 (转)
查看>>
移动通信的主要测量指标及注意事项(转)
查看>>
无盘网络正确网络配置建议-减少卡机蓝屏关键(转)
查看>>
如何在Delphi中调用oracle的存储过程返回数据集(转)
查看>>
ASP指南:ADO/SQL(数据存取) (转)
查看>>
检测网络速度变慢或性能不良的问题(转)
查看>>