@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
self.scrollView.contentSize = CGSizeMake(1600, 1067);
//设置内容的间距
self.scrollView.contentInset = UIEdgeInsetsMake(50, 50, 50, 50);
//设置内容的偏移
self.scrollView.contentOffset = CGPointMake(-50, -50);
//隐藏滚动条
self.scrollView.showsHorizontalScrollIndicator = NO; //水平滚动条
self.scrollView.showsVerticalScrollIndicator = NO; //纵向的滚动条
//不启用弹簧效果
// self.scrollView.bounces = NO;
设置 滚动范围
设置contentSize属性,滚动范围
获取Y轴方向最下面控件的Y值,作为scrollview 的Y值
CGFloat contentH = CGRectGetMaxY(self.lastView.frame) +10;
self.scrollView.contentSize = CGSizeMake(0, contentH);