UIScrollView内的UIScrollView [英] UIScrollView within UIScrollView
问题描述
我如何将某个区域的滑动事件重定向到内部滚动视图?
如果将UIScrollViews设置为只能在一个轴或另一个轴上滚动(即,为其适当设置其contentSize属性)只能垂直滚动,将其contentSize.width值设置为与其bounds.size.width相同)。那么他们应该工作,假设没有两个视图在同一轴滚动。通常,您的子视图垂直滚动,父视图水平滚动。
I have got a hierarchy where UIScrollviews exist within each other.
How may I redirect swipe events for a certain area to an inner scrollview?
If you set your UIScrollViews to only be scrollable in one axis or the other (ie, set their contentSize property appropriately for this. To have a view only be scrollable vertically, set its contentSize.width value to be the same as its bounds.size.width). then they should just work, assuming that no two views scroll in the same axis. Usually, you'll have the 'child' views scroll vertically, and the parent view scroll horizontally.
这篇关于UIScrollView内的UIScrollView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!