0
我想更改Xcode中特定ViewController的方向。如何更改Xcode中特定ViewController的方向
我使a,b,cViewController只改变方向cViewController到LandscapeRight。 (a和b的方向是肖像)
但是,如果我更改cViewController的方向并将ViewController从c移动到b,则b的方向也会更改为LandscapeRight。 (画面转换推)
代码:
和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” –