最近做項目,在用Masonry 七蜘,約束好了scrollView谭溉,但是就是不能滑動。參考網(wǎng)上的方法橡卤,解決了扮念。
```
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make {
make.left.right.top.bottom.equalTo(self.view);
}];
創(chuàng)建一個 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);
}];
重新設(shè)置contentView的bottom
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(view.as_bottom);
}];