UIScrollView: single tap scrolls it to top

后端 未结 5 1821
不知归路
不知归路 2021-01-03 04:25

I have the UIScrollView with pagingEnabled set to YES, and programmatically scroll its content to bottom:

CGPoint contentOffset = scrollView.contentOffset;
c         


        
5条回答
  •  感动是毒
    2021-01-03 04:51

    When scrolling a ScrollView I would suggest using

    [scrollView scrollRectToVisible:CGRectMake(0,0,1,1) animated:YES];

    Where the rect is the position you're after. (In this case the rect would be the top of the scrollview).

    Changing the content offset is not the correct way of scrolling a scrollview.

提交回复
热议问题