簡體   English   中英

iOS6首選界面方向不起作用

[英]iOS6 Preferred Interface Orientation Not Working

我正在嘗試使用iOS6自動旋轉混亂。

我已經研究了幾乎所有與之相關的SO問題,無論我嘗試什么,我都無法根據需要進行輪換工作。

該應用程序正在使用情節提要,其布局如下:

Navigation controller ---> Root view controller ---> Tab view controller ---> View controller ---> Landscape view controller.

當我旋轉模擬器時,視圖控制器會自動旋轉,但是當切換回上一個視圖(設置為縱向)時,該視圖將變為橫向,而應為縱向。 如果我將模擬器向后旋轉,則視圖會再次自動旋轉為縱向,但這應該是自動完成的!

我已經實現了(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation並且在放入它的任何視圖控制器中都不會調用它。

我子類的NavigationController返回topViewControllershouldAutoRotatesupportedInterfaceOrientationspreferredInterfaceOrientationForPresentation和自動旋轉旋轉模擬器似乎何時工作,但preferredInterfaceOrientationForPresentation從未完成它的工作。

有人對此有解決方案嗎?

蘋果似乎已經刪除了按特定方向推送視圖的功能。 不會調用preferredInterfaceOrientationForPresentation ,但僅在彈出或顯示視圖控制器時才調用。 我不得不展示我的風景視圖而不是推送它,並設置shouldAutoRotate = NO。

請參閱: 在iOS6中,將ViewController推入堆棧時強制將ViewController強制為特定的interfaceOrientation,以獲取更多詳細信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM