iPhone Storyboard: different scene for portrait and landscape

后端 未结 3 908
攒了一身酷
攒了一身酷 2020-12-02 17:14

If you scroll down a bit at this Apple Developer Page you\'ll find the section \"Creating an Alternate Landscape Interface\". The basic approach described there is to presen

3条回答
  •  生来不讨喜
    2020-12-02 18:08

    You can make a xib file that contains 2 uiviews, one fore portrait and one for landscape. Assign as file's owner of the xib, the same viewcontroller of the view thet you have in the storyboard. In viewDidLoad load the xib file, and add the appropriete view for portrait or landscape.

    So if you have a storyboard with many viewcontrollers, you can set the two possibility (portrait or landscape view) only in the viewcontrollers that you are interested to change the orientation.

    I used this solution and work very fine !

提交回复
热议问题