Get launch orientation of iPad app

后端 未结 9 701
无人及你
无人及你 2020-12-02 16:19

In my iPad app, I need to run some layout code to set the proper layout depending on the orientation. By default, the layout is configured for the landscape orientation, so

9条回答
  •  佛祖请我去吃肉
    2020-12-02 16:31

    You want to make sure you set the proper keys in your Info.plist to allow for the orientations you want:

    UISupportedInterfaceOrientations
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationPortraitUpsideDown
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    

提交回复
热议问题