UIView not autoresizing correctly iPhone 3.5 inch vs 4 inch screen

ios6

I have a UINavigationController that has as its top UIViewController a UIViewController with a UITabBar on it. (It is not a UITabBarController b/c I am told that Apple does not want you to push a UITabBarController on a UINavigationController).

The UITabBar controls 3 UIViewControllers. When I run it in the simulator, the 3 UIViewControllers work for the 3.5 inch screen, or the 4 inch screen depending on how I use the simulated metrics in Interface Builder. But I can not get the autoresizing to work on both the 3.5 and 4 inch screen. It seems like it's either or.

This should be very simple since it's just UIAutosizeRemaskFlexibileWidth and Height. I have tried this in code and also by playing with Interface builder, and the 3 UIViewControllers controlled by the UITabBar never fit the screen size. I should not have to write branching code for different iphone screen sizes should I?

Best Answer

With iOS 6, struts and springs have been replaced by something called Autolayout.

I suggest you take a look at this link: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2