先看效果:
关键约束代码:
topView(天蓝色视图)的left、right、和top与父视图相等。
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.and.top.equalTo(self);
}];
bottomView(即粉色视图)的left、right、bottom与父视图相等,top等于topView的bottom,高度与topView相等。
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.and.bottom.equalTo(self);
make.top.equalTo(self.topView