4

私は AppStore に、iPhone でポートレート モードを持ち、iPad ではランドスケープで動作するアプリケーションを持っています。ただし、iPad 1 でポートレートが表示され、全体的なビューが破壊されたという報告を受けています。

iPad 1 が特にポートレート モードを表示するのはなぜですか? iPadのバージョンは5.1.1です

4

3 に答える 3

6

iOS 6 では、インターフェイスの向きをサポートする方法が変更されました。両方のバージョンで両方のインターフェイスの向きをサポートするには、OS のバージョンを確認し、それに応じてコードを記述する必要があります。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait); 
}

新しいバージョンのサポート

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotate {
   }

私のView Controllerには次のものがあります:

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

}

- (BOOL)shouldAutorotate {

} 
于 2013-10-08T05:56:15.270 に答える
0

すべてのビュー コントローラーが、サポートしている正しい方向モードを返すことを確認してください。iOS 5 でこのような動作を見たことがあります。私の記憶が正しければ、それが理由でした。

于 2013-10-03T16:36:34.710 に答える
0

私は非常に似ていましたが、AppDelegate.m-> applicationDidFinishLaunching で次のコードを変更して解決しました。

 [self.window addSubview:self.viewController];

 [self.window setRootViewController:self.viewController];
于 2013-10-08T05:29:25.687 に答える