問題:UIScrollView上有子視圖超出界面外需要滑動全面預覽
解決方法:scrollView
的最后一個子控件要加上 make.bottom.equalTo(scrollView.mas_bottom);
[self addSubview:self.scrollView];
...
[self.scrollView addSubview:self.botomView];
//
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.bottom.equalTo(self);
}];
...
//botomView為最后一個字控件
self.botomView.backgroundColor = [UIColor redColor]; [self.botomView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.scrollView); make.top.equalTo(self.radarChartView.mas_bottom); make.left.equalTo(self.scrollView.mas_left).offset(50); make.height.mas_equalTo(200); make.bottom.equalTo(self.scrollView.mas_bottom).offset(-20); }];
以上為示例
參考網址:https://www.jianshu.com/p/d18140eb2251