标签:
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;
标签:
原文地址:http://www.cnblogs.com/lion-witcher/p/5095163.html