方法一:利用偏移量来滚动

- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;

方法二:利用rect来滚动

- (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated; 

注意点:如何使用scrollRectToVisible:animated:这个方法,需要把contentSize的width和height都不能为0,否则不能滚动。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-07-07
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-10-14
  • 2021-10-01
  • 2022-12-23
相关资源
相似解决方案