UIScrollView works as expected but scrollRectToVisible: does nothing

前端 未结 8 2337
一向
一向 2020-12-14 05:46

I have used UIScrollView before, and am using it now, and never had a problem. I\'m now adding it to an old app, and while it works as expected (I can look at

8条回答
  •  轮回少年
    2020-12-14 05:53

    You might want to check and see that the scrollView's delaysContentTouches property is set to NO.

    If you call the method scrollRectToVisible or setContentOffset from a touch within a subview of your scrollView then your scrollView could be holding things up by delaying touches.

    So, make sure you set the following in your scrollView.

    scrollView.delaysContentTouches = NO;
    

    You will most likely be able to move the scrollView with and without animation set to YES.

提交回复
热议问题