Disabling bounces in uitableview also disables scrolling on iOS 5 but not iOS4

大兔子大兔子 提交于 2019-12-12 10:44:41

问题


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.

So I did this:

self.tableView.bounces=NO;

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

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;

But this made no difference.

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?


回答1:


I found the solution here:

UITableView won't scroll after editing view frame and origin

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



来源:https://stackoverflow.com/questions/10763660/disabling-bounces-in-uitableview-also-disables-scrolling-on-ios-5-but-not-ios4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!