- (void)viewDidLoad { [super viewDidLoad]; scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; scrollView.backgroundColor = [UIColor redColor]; // 是否支持滑动最顶端 // scrollView.scrollsToTop = NO; scrollView.delegate = self; // 设置内容大小 scrollView.contentSize = CGSizeMake(320, 460*10); // 是否反弹 // scrollView.bounces = NO; // 是否分页 // scrollView.pagingEnabled = YES; // 是否滚动 // scrollView.scrollEnabled = NO; // scrollView.showsHorizontalScrollIndicator = NO; // 设置indicator风格 // scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite; // 设置内容的边缘和Indicators边缘 // scrollView.contentInset = UIEdgeInsetsMake(0, 50, 50, 0); // scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 50, 0, 0); // 提示用户,Indicators flash [scrollView flashScrollIndicators]; // 是否同时运动,lock scrollView.directionalLockEnabled = YES; [self.view addSubview:scrollView]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 200, 320, 40)]; label.backgroundColor = [UIColor yellowColor]; label.text = @"学习scrolleview"; [scrollView addSubview:label]; [label release]; }
UIScrollView基本用法
相关推荐
UIScrollView、UIScrollView基本用法、UIScrollView详解,UIScrollView常用方法
UIScrollView * headScrollView; UIPageControl * pageControl; NSArray * colorArray; NSTimer * myTimer; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self...
iOS:UIScrollView实现轮播,UIScrollView实现轮播,UIScrollView实现轮播
IOS UIScrollView复用加载数据 ,并且有分页。
UIScrollView实现自动轮播,可调节图片张数,轮播时间。
自定义view,实现UIScrollView自动滚动和手动滚动的结合
UIScrollView 无限自动循环 类似商品推荐产品图无限循环,配合UIPageControl使用
UIScrollView代理触摸实现_图片缩放UIScrollView代理触摸实现_图片缩放
采用uiscrollview实现图片的放大缩小,并截取选框中的图片。
利用UIScrollView进行横纵两个方向的多页面布局滚动。
此Demo是在故事板中的UIScrollView使用AutoLayout实现滚动
UIScrollView分页循环滑动,UITableView横向滑动
UIScrollView不能响应UITouch事件的解决办法,原因是:UIView的touch事件被UIScrollView捕获了。 解决办法:让UIScrollView将事件传递过去。于是最简单的解决办法就是加一个UIScrollView的category。这样每个用到...
UIScrollview 循环滚动 手势 NSTimer
一种N个UIScrollView嵌套的解决方案 使用了一种UIKit Dynamic + Gesture来处理多个UIScrollView、UITableView互相嵌套冲突的解决方案
UIScrollview 图片无缝连续自动滚动 图片每隔2秒自动滚动一次
在iOS开发中会用到的UISCrollView与UITableView嵌套使用的方法
iOS 下类似UITableView的可循环列表利用UIScrollView制作
利用AutoLayout对UiScrollView进行布局,实现简单的引导页。