Search code examples
iphoneuistoryboardiphone-5

iOs 6 different storyboards for iphone5 and other iphones


I have been developing an app for iOs5. Now that the new iPhone is here (with iOs 6) I ran the app in the simulator (iPhone 4 - inch retina) and much of the views don't display properly... What is the best course of action? Is it possible to create another storyboard for the 4-inch display? Or setting up the struts and springs will auto-adjust the views to fit the new display better?


Solution

  • After testing this myself it looks like the struts and springs will fix this for the most part. If however you are creating your views programmatically you will most likely have to make some changes if you put static widths and heights. I ran into an instance of this where I have UIWebViews being populated in a UiScrollView and it did not fill up the screen since I was setting the height statically 323. Here is what the adjustment was:

    CGRect rect = webView.frame;
    rect.size.height = myScrollView.bounds.size.height; (this used to be 323)
    rect.size.width = myScrollView.bounds.size.width;

    This was able to fix the height setting since myScrollview was set to fill the entire display.