5

iOS 8 では、デバイスの向きの検出が追加されましたUIInterfaceOrientationUnknown(プレリリースのドキュメントはこちらで確認してください) 。

  • UIInterfaceOrientationUnknown

    デバイスの向きを特定できません。

    iOS 8.0 以降で利用できます。

typedef enum : NSInteger { 
    UIInterfaceOrientationUnknown = UIDeviceOrientationUnknown, 
    UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait, 
    UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown, 
    UIInterfaceOrientationLandscapeLeft = UIDeviceOrientationLandscapeRight, 
    UIInterfaceOrientationLandscapeRight = UIDeviceOrientationLandscapeLeft 
} UIInterfaceOrientation; 

Portrait私が見る限り、このデバイスは、UpsideDownLandscapeRightおよびの 4 つの方法しかありませんLandscapeLeft。では、デバイスの向きが不明になるのはどのような状況でしょうか?

4

2 に答える 2

0

私はappDelegateを準備して呼び出すUIInterfaceOrientationUnknown前にウィンドウの作成が行われたときの状態に直面しました。UIApplicationapplicationDidLaunch

ところで、これは Typhoon DI フレームワーク内のスウィズリング マジックによって達成されました。

于 2016-03-26T19:51:11.507 に答える
0

たとえば、デバイスが縦向きと横向きのちょうど中間の位置にある場合など、何度も見てきUIInterfaceOrientationUnknownました (したがって、どちらの向きが正しいかはわかりませんでした)。

于 2016-03-26T19:56:25.453 に答える