0
Hi I'm using following code to show my app's login screen.   
LoginViewController * loginController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
       UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:loginController];
       navController.modalPresentationStyle = UIModalPresentationFormSheet;
       [self.navigationController presentModalViewController:navController animated:YES];

Its loading properly. Here my problem is my app should be in landscape mode only. Here I'm using UIModalPresentationFormSheet so app is automatically appearing in portrait mode. I would like to force my app to change to landscape mode after this login view loads. some one please help me how to rotate my view into landscape mode after this UIModalPresentationFormSheet loads. (It means in LoginViewController's viewDidLoad mode I have to force my app to change to landscape mode. How can I achieve that). Thanks in advance

Bharath
  • 161
  • 1
  • 3
  • 13

1 Answers1

0

Try re-writing your User Interface Frame attributes with landscape co-ordinate values.

Do this in

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                                         duration:(NSTimeInterval)duration

and with the proviso

 [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];

if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft
    ||  toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
NSNoob
  • 5,548
  • 6
  • 41
  • 54