iOS 6 で向きの方法が変更されました。ポートレート モードのアプリ全体が多くのビュー コントローラー (タブ バー ビュー コントローラーではありません) を取得しました。回転時に、ビュー コントローラーの 1 つをランドスケープ モード (実際には webView を表示) に回転させたいだけです。以下のメソッドは xcode 4.4 で機能していましたが、Xcode.4.5 では機能しません。
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight );
上記の方法は xcode 4.5 では機能しません。このため、以下の方法を変更しましたが、機能していません....何か提案があればよろしくお願いします。
- (BOOL) shouldAutorotate{
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationPortrait];
return self.modalViewController.shouldAutorotate;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}