上次我運行我創建的iOS應用程序時,它一定是用於部署目標5.0和相關SDK(有可能早在4.3)。部署現在是6.1。我的應用程序只運行景觀,並在景觀中運行良好。但在我更新了我的iPad和iOS SDK並在大約一年後第一次運行此應用程序後,似乎有所改變。iOS應用程序的iPad方向 - 自新版本
這些按鈕顯示爲iPad處於縱向模式。這是錯誤的,因爲它應該是在橫向(並且它曾經工作得很好)。
最新更新有哪些變化?
我在Xcode中支持的界面方向只有「風景右側」被選中,並且在信息部分中,我有「支持的界面方向」,只有一個項目:「風景(右側主頁按鈕)」。
在打開的應用程序第一次打開時,我有
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
,也是viewDidLoad
的第一行是
self.view.frame = CGRectMake(0, 0, 1024, 768);
所以我的主視圖控件爲什麼代碼繪製按鈕爲如果它處於肖像模式?
UPDATE
我試圖與
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationLandscapeRight & UIInterfaceOrientationLandscapeLeft;
}
更換shouldAutorotateToInterfaceOrientation
方法,但它仍然無法正常工作。
所以,現在部署目標是iOS的6.1? – jamapag 2013-02-15 20:47:01
是的,沒錯。 – CodeGuy 2013-02-15 20:47:18
'應該在iOS 6中棄用shouldAutorotateToInterfaceOrientation'。 – jamapag 2013-02-15 20:49:05