iOS develop. How to extend UIScrollView's scroll event responding area?

前端 未结 3 885
暗喜
暗喜 2020-12-17 16:34

I have a UIScrollView\'s paging enabled and set its clipToBounds = NO so that I can see outside current page.

What I want is to enable the

3条回答
  •  一生所求
    2020-12-17 17:38

    Put the scrollview into a uiview and disable clipsToBounds of the scrollview. the scrollview must be the size you want for paging. you will see the content outside of the scrollview but paging wil still be the same. You can activate clipsToBounce for the outside view to limit the size of the scrollview.

    Overwrite the hitTest of the view to redirect the touches to the scrollview... then you will be able to also scroll by touching outside of the scrollview.

提交回复
热议问题