Reputation: 4837
In addition to what the title says
[_mainContainerView addConstraint:[NSLayoutConstraint constraintWithItem:_mainContainerView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:self.second.view attribute:NSLayoutAttributeBottom multiplier:1 constant:0]];
As you see in the screenshots, the red background does not follow the main container view when I resize the window. Do you know why this is happening?
In order to fix this error I had to set constraints for width/height. I also added constraints for top/bottom alignment to superview.
Upvotes: 0
Views: 86
Reputation: 1615
I would prefer:
[_mainContainerView addConstraint:[NSLayoutConstraint constraintWithItem:self.second.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:_mainContainerView attribute:NSLayoutAttributeBottom multiplier:1.f constant:0.f]];
Upvotes: 1