首页 > 其他 > 详细

scrollview滚动到指定区域的两种方法

时间:2015-07-08 02:04:33      阅读:984      评论:0      收藏:0      [点我收藏+]

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

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

方法二:利用rect来滚动

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

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

scrollview滚动到指定区域的两种方法

原文:http://www.cnblogs.com/samyangldora/p/4629000.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!