How can I set the scrolling position of an UIScrollView?

前端 未结 2 462
闹比i
闹比i 2021-01-07 17:50

I\'ve seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that \"offset\" mean?

2条回答
  •  醉梦人生
    2021-01-07 18:09

    You can control the animation using

    [UIView animateWithDuration:1.2 animations:^{_scrollView.contentOffset = CGPointMake(X, Y);}];
    

提交回复
热议问题