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

有帮助吗?

解决方案

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]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top