Using UILongPressGestureRecognizer For Subviews of UIScrollview

后端 未结 5 1870

For the past four hours, I have tried many Stack Overlow solutions but none have helped solve my problem.

Here it is,

  • I have a UIScrollView
5条回答
  •  遥遥无期
    2020-12-21 07:47

    Woohoo it works!

    The problem was:

    imgContainer was a UIView with an empty frame with several UIImageViews as subviews

    I was under the impression that as I added a subview to imgContainer, imgContainer would expand.

    This is not true.

    I had to set imgContainer's frame to the same content frame as the scroll view and then everything became ok.

    I hope this answer helps any other future iOS firs timers like me.

提交回复
热议问题