1

I am creating an app that is exclusively in portrait mode, except in one view. It switches to landscape fine, but when using the "back" button to go to the previous view, which should be displayed in portrait, it now is displayed in landscape.

How can I force the UIViewController to be presented in portrait even if the previous controller was landscape?

The following code is no longer working as it was deprecated...

UIViewController *c = [[UIViewController alloc]init];
[self presentModalViewController:c animated:NO];
[self dismissModalViewControllerAnimated:NO];
rmaddy
  • 314,917
  • 42
  • 532
  • 579
George Friday
  • 585
  • 1
  • 6
  • 22
  • No one knows how to force a view to be in portrait mode after switching from a view in landscape mode? – George Friday Aug 24 '13 at 22:58
  • check out my answer to your question http://stackoverflow.com/questions/18424846/force-portrait-mode, also wait to get some answers for the first question then post some more. You've posted three question about the same issue. – Adrian P Aug 25 '13 at 05:29

1 Answers1

0

Based on status bar orientation you can change the device orientation. After clicks the back button check the orientation of device and based on that set the orientation.

Ganesh
  • 524
  • 1
  • 4
  • 16