Do we need to use 2 Storyboard for a Universal app?

前端 未结 6 1744
星月不相逢
星月不相逢 2021-02-06 12:01

I have a project for iPhone and iPad. The iPad needs a split view controller. Do we create two separate storyboards? One for iPhone (using autolayout we can support all devices)

6条回答
  •  梦谈多话
    2021-02-06 13:06

    No need for two storyboards any more in iOS 8! We can use Adaptive UI in order to tailor the same storyboard all different sizes of iPad and iPhone.

    You can find a nice tutorial in here http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial

    And also you can find a nice video by apple in WWDC conference here and search for "Building Adaptive Apps with UIKit"

    Basically we can handle different screen sizes by defining elements of our UI in storyboard for different size classes. We can also define different Auto layout constraints for different size classes.

    And these are all possible size classes in iOS 8 ( I took the image from https://medium.com/@getaaron/ios-8-development-tips-for-iphone-6-and-iwatch-1c772554ffe0)

    enter image description here

提交回复
热议问题