开发者

Is the UITableView and the UIScrollViewDelegate have the conflict?

开发者 https://www.devze.com 2023-01-12 03:45 出处:网络
I have a UIScrollView and a UITableView. the class have implemented. The UIScrollView can scrolling with many pages. When the user scrolling, a new table view will appear, but when I scroll开发者_运维

I have a UIScrollView and a UITableView. the class have implemented . The UIScrollView can scrolling with many pages. When the user scrolling, a new table view will appear, but when I scroll开发者_运维知识库ing the table view, the application crash.

Is there any UITableView and UIScrollViewDelegate when the UITableView Scrolling? thank you.


There is one thing that you should notice even though it will not likely to cause your app to crash. The UIScrollView and UITableView is overlap from each other. When you touch the screen and scroll, both of them will try to get that event, and only one of them can catch that event. The problem is that UITableView inherits from UIScrollView so that it is also a UIScrollView and catch scrolling event.

I recommend you to have only UITableView and detect when user scroll far enough, you move them to the next page

0

精彩评论

暂无评论...
验证码 换一张
取 消