Get launch orientation of iPad app

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

    Use the status bar orientation instead to detect it.

    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

    then perform the if's on the "orientation" you have obtained from above.

提交回复
热议问题