UIScrollView behavior is different in iOS8

旧街凉风 提交于 2019-12-22 08:15:24

问题


I have the following layout

So it's basically a scroll view that occupies whole screen. Content size is set to triple-width and same height. Inside the scroll view - there is container view and three table views - one per page. Only middle table view is visible initially.

This allows me to use scroll view horizontal scrolling to navigate between the tables and vertical scrolling inside the middle table.

I know that Apple doesn't really recommend putting UITableView inside UIScrollView, but in this particular case I don't know how to implement it differently, and until iOS8 everything was working fine.

UIScrollView would not recognize any vertical scrolling (since content height was equal to scroll view height) and these gestures were passed directly to UITableView.

But starting in iOS8 - this getting broken. UIScrollView would allow some vertical scrolling and basically intercept scrolling gestures sent to UITableView.

I created a simple project that works fine in iOS7 but is broken in iOS8. Anybody has any idea how to fix this problem?

Link to the project: https://dl.dropboxusercontent.com/u/6402890/TablePaging.zip


回答1:


I haven't been able to solve this and as I mentioned in comments had to re-write logic using built-in UIPageViewController class.




回答2:


If I change the Class of your ScrollView in Interface Builder to UIScrollView, it fixes part of the problem. Now just the UITableView goes up and down, and I go left-and-right, but haven't gotten rid of the space at the top.



来源:https://stackoverflow.com/questions/25558630/uiscrollview-behavior-is-different-in-ios8

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