我有一些代碼,我曾經使用presentingViewController.interfaceOrientation
來確定當前支持的接口方向UIViewController
。由於interfaceOrientation
已被棄用,我已經用[[UIApplication sharedApplication] statusBarOrientation]
替換了該代碼,它工作正常。但是,在iOS9和iOS8中,它不起作用(當我檢查shouldAutorotateToInterfaceOrientation
,supportedInterfaceOrientations
和preferredInterfaceOrientationForPresentation
中的方向時,我得到了一些非常有趣的結果。確定沒有[[UIApplication sharedApplication] statusBarOrientation] UIViewController的UIInterfaceOrientation?
所以我想知道,有無論如何確定視圖控制器的接口方向而不使用[[UIApplication sharedApplication] statusBarOrientation]
? (需要在左右景觀之間進行區分,並將肖像右側上下顛倒)。
檢查方向是你能得到這個答案? –
@DeepakSharma我不記得了。當我查看我的代碼時,我正在使用[[UIApplication sharedApplication] statusBarOrientation],因此不知道我在iOS9和iOS8中修復了這個問題。 –