Get current orientation of iPad?

后端 未结 11 1737
野趣味
野趣味 2020-12-02 07:28

In a given event handler (not the \"shouldAutorotateToInterfaceOrientation\" method) how do I detect the current iPad orientation? I have a text field I have to animate up

11条回答
  •  鱼传尺愫
    2020-12-02 07:59

    I think

    [[UIDevice currentDevice] orientation];
    

    is not really reliable. Sometimes it works, sometimes not... In my apps, I use

    [[UIApplication sharedApplication]statusBarOrientation]; 
    

    and it works great!

提交回复
热议问题