Get launch orientation of iPad app

后端 未结 9 697
无人及你
无人及你 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:45

    Use self.interfaceOrientation in your view controller - it's a property of UIViewController that is set by iOS for you, and in some cases is more reliable than [[UIDevice currentDevice] orientation].

    Here's a detailed description: http://bynomial.com/blog/?p=25

提交回复
热议问题