Xcodeで特定のViewControllerの向きを変更したいと思います。Xcodeで特定のViewControllerの向きを変更する方法
私は、a、b、cViewControllerを作成し、方向のみをcViewControllerをLandscapeRightに変更します。 (aとbの向きはポートレートです)
しかし、私はcViewControllerで方向を変更し、ViewControllerをcからbに移動すると、bの向きもLandscapeRightに変更されます。 (画面遷移がプッシュである)
コード:
AとbViewControllerのDidLoad
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
cViewControllerのDidLoad
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
にはどうすればいいの向きだけcViewControllerを変更できますか?
これを「DidLoad」から「DidAppear」に変更します。 –