ScrollView + n个view
1.storyboard布局一个ScrollView![布局结构](https://i-blog.csdnimg.cn/blog_migrate/6da0451166cfa541f22c660659cf50f9.jpeg)
2.拖出两个输出口,定义三个属性
@property (weak, nonatomic) IBOutlet UIScrollView *XMScrollView;
@property (weak, nonatomic) IBOutlet UIView *scrollContentView;
@property (nonatomic) BOOL isBeginScroll;
@property (nonatomic) BOOL isBeginAnimationScroll;
@property (nonatomic) NSInteger beginX;
3.在viewDidAppear中重新设置scrollContentView的布局宽和tableVIew大小和位置
for (NSLayoutConstraint *constraint in self.scrollContentView.constraints) {
if (constraint.firstAttribute == NSLayoutAttributeWidth) {
[constraint setConstant:self.view.frame.size.width*3];
}
}
[self.tableView1 setFrame:CGRectMake(0,