Reputation: 572
I have iPad application which uses iOS7 SDK with auto-layout. my main view have a sub view which is a UITabBarController which programmatically creates it's view controller's (storyboard.instaniateViewController..).
Inside the views - when i'm in portrait mode - everything is fine. but when i move to landscape mode - the view's width is changed correctly, but the view's height remains as in Portrait mode. The result is that my screen is truncated in a height.
Any ideas why it happens? constrains seems fine. I can change it by programmatically change the vie's frame, but it doesn't seem right.
Thanks
Upvotes: 0
Views: 383
Reputation: 572
OK, i see what the problem was - somewhere up the view's hierarchy was defined:
[viewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth]
and that meant that the height was not flexible of course. the fix is easy once i saw it:
[viewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]
Upvotes: 1