0

I'm updating an old app to the new iPhone sizes and I ran into a problem. Auto-layout broke several pieces of an old storyboard.

No problem, just go in and uncheck auto-layout. Run again (3.5in screen) and works perfectly again, then run in 4in screen, nothing re-sizes. Spend next couple minutes checking and unchecking auto-layout box and running it on various screens. This is clearly the problem.

Turn off auto-layout, select the top view in your view controller, open up the size inspector inspector and take a look at the Autosizing box. The inner arrows which let the view re-size are grayed out. You can't select them. From looking in example view, it's obvious the view won't re-size. Since it won't re-size, it won't work properly on a 3.5in and 4in screen.

Anyone see a (fairly simple) way around this limitation?

I really have no desire to update storyboards which don't need UI updates to work properly with auto-layout, but the other option seems to be writing testing code and throwing it into all my view controllers, which would probably be as much effort as fixing all my storyboards to work with auto-layout.

DBD
  • 23,075
  • 12
  • 60
  • 84

1 Answers1

1

Auto layout by default generates a best guess at the constraints that need to be generated. This is often times not ideal. Sometimes you can get around this limitation by simply adjusting the Content Hugging and Compression Resistance priorities. Other times you may need to go in and add or remove constraints that do not give the desired result. The WWDC video gives a pretty good explanation on adding auto layout to your apps, including things to look out for (like setting static frame sizes). If you want a basic tutorial on auto-layout you can try this blog post here: http://bit.ly/RE6VuW .

rdrobinson3
  • 360
  • 1
  • 4
  • I'm sorry, but I don't see how this relates to my question. I'm looking for automatic top level view resizing WITHOUT converting all my XIBs to use auto-layout. – DBD Oct 05 '12 at 13:09