码迷,mamicode.com
首页 > 其他好文 > 详细

UIScrollView

时间:2016-01-02 20:26:12      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:

UIScrollView是所有滑动视图的基类

UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)];

scroll.background = [UIColor redColor];

 scroll.contentSize = CGSizeMake(2000, 2000);  //设置UIScrollView的内容区域大小, 当UIScrollView的内容大小大于UIScrollView的Frame的大小时,UIScrollView可以滑动.

scroll.contentOffset = CGPointMake(200, 0); //设置UIScrollView的内容偏移量.

scroll.showHorizontalScrollIndicator = NO; //关闭水平的滑动指示条

scroll.showVerticalScrollIndicator = NO; //关闭竖直的滑动指示条

scroll.scrollEnabled = NO; //禁止UIScrollView滑动

scroll.pagingEnabled = YES;  //允许UIScrollView整页滑动

scroll.directionalLockEnabled = YES;  //设置UIScrollView的单向滑动

scroll.bounces  = NO;  //禁止UIScrollView的边界反弹效果.

scroll.alwaysBounceHorizontal = YES;  //即使内容的size大小小于ScrollView的frame的大小, 依然具有边界反弹效果.

scroll.alwaysBounceVertical = YES;

scroll.scrolsToTop = NO;  //禁止点击状态条滑动到顶部.

scroll.maximumZoomScale = 4.0;  //设置UIScrollView的缩放最大最小值

scroll.minimumZoomScale = 0.5;

 

UIScrollView

标签:

原文地址:http://www.cnblogs.com/lion-witcher/p/5095163.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!