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」 –