0
親ビューは画面に赤く表示され、その中に緑色の子ビューがあります。子を左下隅に配置しようとすると、以下のコードが失敗しました。この問題を解決する方法iOS AutoLayout(石積みあり)、子供のボトムを親ボトムと同じに設定できませんでした。
[superView addSubview:self];
self.backgroundColor = [UIColor redColor];
[self makeConstraints:^(MASConstraintMaker *make) {
make.width.left.top.equalTo(superView);
make.height.mas_equalTo(50);
}];
UIView *header = [[UIView alloc] init];
[self addSubview:header];
header.backgroundColor = [UIColor greenColor];
[header makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.width.mas_equalTo(30);
make.bottom.equalTo(self);
}];
?