我想從支持景觀(而在景觀模式)的視圖控制器,到一個明確沒有(也不應該)支持景觀。我這樣做如下:問題pushViewController從景觀到肖像
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
理想情況下,我想新的viewController,我推入到堆棧中最初開始在肖像,而不是風景。奇怪的是,即使這個方法實施,它開始在景觀。
我唯一的猜測是,蘋果不希望用戶從風景轉換爲肖像(儘管允許我們從風景轉回到先前的肖像控制器)。
任何見解和/或幫助將不勝感激。
這對我來說只是通過pushViewController從縱向移動到僅橫向的視圖。保存你不得不調用未公開的私人API [[UIDevice currentDevice] setOrientation:UIDeviceOrientationLandscapeRight]謝謝! – MyCSharpCorner 2011-10-29 07:26:40