UIViewController orientation problems in iPad
I am presenting MFMailComposeViewController as modal from a view controller (lets call it xyz) added to nav stack. When user clicks on cancel button, the MFMailComposeViewController is dismissed. This works fine when xyz is added to nav stack in portrait/landscape mode and the device orientation doesn't change until after cancel is clicked.
present modal - alloc init MFMailComposeViewController on a button tap
[self.navigationC开发者_如何学运维ontroller presentModalViewController:mailController animated:NO];
dismiss modal - mailComposeController: didFinishWithResult: error
[self.navigationController dismissModalViewControllerAnimated:YES];
If orientation changes between xyz being displayed and the mail view controller canceled, xyz's orientation changes unexpectedly.
For example:
- Device orientation portrait
- pushViewController xyz on button tap
- change device orientation to landscape, all views are rotated as expected
- present MFMailComposeViewController
- mail controller displayed on landscape mode
- tap on cancel or send email
- xyz orientation rotated 90 degrees (unexpected) - expected: xyz orientation shouldn't change.
I don't know what's going on. Any help is appreciated.
精彩评论