demo地址:https://gitee.com/songshuangjun/scrollView
就简单点来,一个scrollIView ,内部一个innerView.具体操作截图如下。
1.约束scrollIView的上下左右
2。innerIView的宽和高。
3。
.
4.
5.结合代码。
demo地址:https://gitee.com/songshuangjun/scrollView
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *InnerW;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *innerH;
@end
@implementation ViewController
- (void)updateViewConstraints
{
[super updateViewConstraints];
/*
* 这里设置ScrollView的ContentSize;
* 这里设置了5横屏, 俩竖屏滚动。
*/
_InnerW.constant = [UIScreen mainScreen].bounds.size.width * 5;
_innerH.constant = [UIScreen mainScreen].bounds.size.height * 2;
}