Reputation: 17651
I'm new to AutoLayout - My Screen structure is as follows in this image -
Basically all looks fine when portrait - if I spin the screen to landscape the header centres but the screen sticks to the portrait width - as follows -
I've been playing around with constraints for over an hour but cant make it stretch to full width - any idea what I'm doing wrong!?
Upvotes: 0
Views: 281
Reputation: 557
When using the buttons on the bottom of the storyboard to position a view, it often positions them relative to an other view (looks like the login-view is centered to the blurred image, but we cant see your other constraints).
Therefore you should ctrl-click and drag the view from the left panel to the view you want to position him relative to (in this case the view on the highest level).
You also should click on the little orange arrow to see all the constraints Xcode can not resolve properly.
Upvotes: 1
Reputation: 1570
I assume that Image View - blurredBG
is the BG image, and View
below it is the login view.
In interface builder, tap the ruler icon in the right pannel & choose center position for your login view (i.e. not starting point as x & y).
you can do the same for your blurredBG but its size should be 1024px * 1024px.
you can also re-position both of them in -(void)viewWillLayoutSubviews
Hope it helps :)
Upvotes: 0