私は iPad アプリを持っています。ロード中は常に ladnscapeLeft モードでロードする必要があります。病棟の後、向きの変更に回転して応答し、他の向きに移動できます。どうすればそれを達成できますか? plist.info ファイルを変更して、landscapeleft のみにしようとしましたが、アプリのライフ サイクル全体でその向きがロックされます。
明確にするために、アプリは ladnscapeLeft でのみロードする必要があります。ロードが完了すると、他の向きに応答できます。
私は iPad アプリを持っています。ロード中は常に ladnscapeLeft モードでロードする必要があります。病棟の後、向きの変更に回転して応答し、他の向きに移動できます。どうすればそれを達成できますか? plist.info ファイルを変更して、landscapeleft のみにしようとしましたが、アプリのライフ サイクル全体でその向きがロックされます。
明確にするために、アプリは ladnscapeLeft でのみロードする必要があります。ロードが完了すると、他の向きに応答できます。
UIViewControllerローテーション イベントをオーバーライドする必要があります。次に例を示します。
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
if (appDelegate.topViewController != nil) {
return [appDelegate.topViewController supportedInterfaceOrientations];
} else {
return UIInterfaceOrientationMaskPortrait;
}
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
if (appDelegate.topViewController != nil) {
return [appDelegate.topViewController preferredInterfaceOrientationForPresentation];
} else {
return UIInterfaceOrientationPortrait;
}
}