Masonry/SnapKit 约束scrollView的问题

最近做项目,在用Masonry ,约束好了scrollView,但是就是不能滑动。参考网上的方法,解决了。

```
 [self.scrollView      mas_makeConstraints:^(MASConstraintMaker                       *make {
make.left.right.top.bottom.equalTo(self.view);
}];
 创建一个 contentView 添加到 scrollView上
  self.contentView = [[UIView alloc] init];
 [self.scrollView addSubview:self.contentView];
约束
[self.contentView     mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.scrollView);
make.width.equalTo(self.scrollView);
}];
重新设置contentView的bottom

[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(view.as_bottom);
}];

你可能感兴趣的:(Masonry/SnapKit 约束scrollView的问题)