how do I detect the iPhone orientation before rotating

后端 未结 7 1756
忘了有多久
忘了有多久 2020-12-28 09:32

In my program I\'m moving things based on rotation, but I\'m not rotating the entire view. I\'m Using :

  static UIDeviceOrientation previousOrientation = U         


        
7条回答
  •  死守一世寂寞
    2020-12-28 09:52

    A more complete example on how to obtain device orientation from accelerator readings can be found here As the solution relies on accelerator readings, it wouldn't work on the simulator, so you'll have to work on the device... still looking myself for a solution that works on the simulator.

提交回复
热议问题