I have a parent view which is red on the screen, and inside it, there is a child view which is green. When trying position child to left-bottom corner, code below failed.
[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);
}];
How to fix this issue?