我想在我的應用程序中實現自動旋轉,基本上UINavigationController有很多UIViewControllers被推到它上面。shouldAutorotateToInterfaceOrientation&UINavigationController
我已經複製粘貼此我第一次的UIViewController(也被壓入的UINavigationController):
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return YES; }
一切都工作得很好......但是,如果我在那個代碼到第二的UIViewController粘貼(即第一一個按鈕點擊後,一個頂部) - 自動旋轉將不起作用。當UIViewController初次初始化時,shouldAutorotateToInterfaceOrientation被調用,但在它可見並旋轉設備後 - 什麼都不會發生。
所以結果是:第一視圖獲取旋轉以及 - 縱向/橫向...但我按一下按鈕,進入我仍然堅持成縱向或橫向,不管是積極的第二種觀點之後。
我試着子類的UINavigationController和設置shouldAutorotateToInterfaceOrientation存在,但也不能正常工作。
我在做什麼錯?
請參閱我的答覆在這裏作爲附加信息:http://stackoverflow.com/questions/3213885/ipad-orientation-change-issue/3239351#3239351 – iwasrobbed 2010-07-13 16:45:05