禁用uitableview中的退回也会禁用iOS 5上的滚动但不禁用iOS4 [英] Disabling bounces in uitableview also disables scrolling on iOS 5 but not iOS4

查看:87
本文介绍了禁用uitableview中的退回也会禁用iOS 5上的滚动但不禁用iOS4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在导航控制器中有一个带有表格视图的应用程序;我想禁用弹跳,这样当我的表处于编辑模式时,用户可以向下滚动并找到要删除的行;否则,它会反弹而不给他们机会按下该行旁边的删除图标。

I have an app with a table view in a nav controller; I wanted to disable bouncing so that when my table is in Edit mode, user can scroll down and find rows to delete; otherwise, it would bounce back and not give them the opportunity to press the delete icon next to the row.

所以我这样做了:

self.tableView.bounces = NO;

当我在iOS上运行我的应用程序时4,这就像一个魅力。用户可以滚动并且表格不会反弹。

When I run my app on iOS 4, this works like a charm. User can scroll and the table does not bounce back.

但是在iOS 5上,滚动对表格来说根本不起作用。没有卷轴。所以为了安全起见,我这样做了:

But on iOS 5, the scrolling is also not working at all for the table. No scroll. So to be safe, I did this:

    self.tableView.bounces=NO;
    self.tableView.scrollEnabled=YES;

但这并没有区别。

我以编程方式创建我的表视图及其导航控制器;其他一切都与他们合作。任何想法为什么禁用反弹也会阻止在iOS 5上滚动?

I create my table view and its nav controller programmatically; everything else is working fine with them. Any idea why disabling bounces would also prevent scrolling on iOS 5?

推荐答案

我在这里找到了解决方案:

I found the solution here:

UITableView不会滚动编辑视图框和原点后

如果您手动设置了tableview的原点,则在iOS 5上会禁用滚动。在iOS 4上它不是。真是太遗憾了。

If you manually set the origin of the tableview, on iOS 5 it disables scrolling. on iOS 4 it is not. a shame, really.

这篇关于禁用uitableview中的退回也会禁用iOS 5上的滚动但不禁用iOS4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆