我正在創建一個具有橫向正確方向的應用程序。爲此,我在info.plist
文件中設置了Initial interface orientation
屬性。然後在我處理的每個視圖中Ipad方向不能正常工作
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return(interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
它在模擬器中正常工作,但在設備中其行爲不同。 我的第一個看法是正確的。有popover顯示另一個肖像模式的視圖。不過我的狀態欄是在園林的權利..
從一個視圖導航到我使用的另一種觀點..
self.window.rootViewController = self.myNav;
我有多個導航控制器及添加使用上這些代碼。 我沒有得到什麼問題。
任何幫助將不勝感激。
EDIT:
我用了
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
我從來沒有這個問題在模擬器,但設備,而不是每次都得到這個。我也使用了Supported interface orientations (iPad)
,併爲item0
設置了Landscape (right home button)
的值。
在此先感謝
我這個已經做... 我使用後試圖'[的UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]' 我從來沒有這個問題在模擬器,但得到這個裝置中,而不是每次都.. –