1、简单实用
UIImage *image = [UIImage imageNamed:@"ipad.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
// 设置内容的宽高(滚动范围)
self.scroll.contentSize = image.size;
// 增加滚动范围
self.scroll.contentInset = UIEdgeInsetsMake(0,0,0,40);
self.scroll.backgroundColor = [UIColor grayColor];
// 可视范围
//self.scroll.frame.size
[self.scroll addSubview:imageView];
2、缩放:用到代理 UIScrollViewDelegate协议
// 创建UIScrollView
UIScrollView *scroll = [[UIScrollView alloc] init];
scroll.frame = self.view.bounds;
scroll.backgroundColor = [UIColor grayColor];
[self.view addSubview:scroll];
// 添加图片
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ipad.png"]];
[scroll addSub