How to install one of the screens in landscape mode in iphone?

I am developing an iphone application in iOS7, I am facing a problem in a standalone single screen in landscape mode, while other screens remain in portrait mode. I am using a story board.

0
source share
1 answer

I used the following and its work for me both in iOS6 and iOS7, try the following way:

// Added method for Autorotation in you app delegate - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ //NSLog(@"AppDelegate -- supportedInterfaceOrientationsForWindow"); if([UICommonUtils isiPhone]){ return UIInterfaceOrientationMaskPortrait; }else if(flagOrientationAll == YES){ return UIInterfaceOrientationMaskLandscape; } } 

Add the following parameters to your control controller:

 // set flag "flagOrientationAll" to rotate only one view in your perticular view -(void)viewWillAppear:(BOOL)animated { NSLog (@"webViewController -- viewWillAppear"); [super viewWillAppear:animated]; PlayWithWSWithLibAppDelegate *delegate = (PlayWithWSWithLibAppDelegate *) [[UIApplication sharedApplication] delegate]; delegate.flagOrientationAll = YES; } -(void)viewWillDisappear:(BOOL)animated { NSLog (@"webViewController -- viewWillDisappear"); PlayWithWSWithLibAppDelegate *delegate = (PlayWithWSWithLibAppDelegate *)[[UIApplication sharedApplication] delegate]; delegate.flagOrientationAll = NO; } 
+2
source

Source: https://habr.com/ru/post/959470/


All Articles