私のルートビューコントローラーは縦向きモードです。このルート ビュー コントローラーにボタンがあり、ボタンのアクション コードを次に示します。
-(IBAction)VideosView
{
VideosDetailViewController *videoview=[[VideosDetailViewController alloc] initWithNibName:@"VideosDetailViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:videoview animated:YES];
[videoview release];
}
VideosDetailViewController をランドスケープ モードにしたいと思います。この問題を解決するために、私は多くの方法を試しましたが、うまくいきません。これは私がこれまでに試したことです:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
しかし、これは私にはうまくいきません。助言がありますか?