I'm trying to set a constraint where the width of two views should fill the screen. If I change the width of one view, the other view should change accordingly:
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-8-[view1]-8-[view2]-8-|" options:0 metrics:nil views:views]];
I think this is rather simple, but the code seems to ignore the size of view2
. view1
keeps getting the entire width of the screen and setting the frame of view2
doesn't affect the width of view1
.
What am I missing?