UIScrollView within UIScrollView

前端 未结 2 1936
执笔经年
执笔经年 2021-01-06 03:50

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?

2条回答
  •  北海茫月
    2021-01-06 04:50

    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.

提交回复
热议问题