這是從以前的問題,我問了一個延續:iPhone View StrategyiPhone視圖不會旋轉
我現在用下面的方法來視圖之間切換:
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
[window setRootViewController:[self gameViewController]];
[[[self gameViewController] view] becomeFirstResponder];
我遇到的問題是我的視圖沒有正確旋轉(狀態欄旋轉,但沒有別的)。初始視圖沒問題,但是使用上述方法導航到的任何視圖都存在旋轉問題。
我在我所有的視圖控制器的實現方法shouldAutorotateToInterfaceOrientation如下:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES to allow autorotation
return YES;
}
這已成爲一個有點棘手的問題對我來說。有任何想法嗎?
謝謝你,艾倫
[完全重複](http://stackoverflow.com/questions/3773012/iphone-view-wont-rotate) – 2010-09-22 19:57:44
對不起,刪除了另一個! – 2010-09-22 20:23:08
這不是切換視圖的正常方式... – 2010-09-22 23:47:29