iOS 双击状态栏滚到视图顶部无效

在含有两个tableView的界面中,设置scrollsToTop属性后,双击状态栏无法滚动到顶部。经过排查,发现解决方案。
摘要由CSDN通过智能技术生成

在我的项目中有一个界面有两个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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值