0

I am presenting a UIModalView in a UISplitViewApplication. I have wired up a "done" action, which is:

- (IBAction) donePressed:(id) sender
{
    [self dismissModalViewControllerAnimated:YES];
}

When I press the button, the orientation of the device changes to potrait mode. Why is this?

jscs
  • 63,694
  • 13
  • 151
  • 195
aherlambang
  • 14,290
  • 50
  • 150
  • 253
  • Not 100% related to your question, but the answers here may help: http://stackoverflow.com/questions/2953351/iphone-landscape-faq-and-solutions – Eric Petroelje May 18 '11 at 19:32

2 Answers2

1

I don't think you've provided enough code for anyone to be able to give you an accurate answer, but one possibility is that you haven't implemented the following method in all of your controllers:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
Erik B
  • 40,889
  • 25
  • 119
  • 135
0

I had this problem and the accepted solution didn't solve it for me.

I was trying to load a modal view controller from a UIPopoverController, and every time it was dismissed it would rotate to portrait.
When I moved the modal view to load from the Detail View Controller of the UISplitView it worked fine.

JordanC
  • 4,339
  • 1
  • 22
  • 16