pass scroll event from uibutton to uiscrollview

后端 未结 4 665
旧巷少年郎
旧巷少年郎 2021-02-14 15:59

i have horizontal UIScrollView which is extended from UIScrollView and i added UIButtons horizontally. i can only scroll out of the button

4条回答
  •  庸人自扰
    2021-02-14 16:30

    that functionality is already built in. When you have a UIControl element as a subview of a scroll view and a touch event is detected, it is initially passed to the UIScrollView. IF, after a moment or two there hasn't been sufficient movement in the touch event, it gets passed on to the button.

提交回复
热议问题