1
votes

I have a problem in iOS. It's support all interface orientations. But when orientation-locked modal controller is presented (by calling [self presentViewController:UIViewController animated:YES completion:nil]), sometimes the UI orientation is messed up.

Here are the steps:

  1. Orientate the device so it's in portrait mode (doesn't matter portrait or upsideDown).
  2. Present view controller as modal controller. This controller only support landscape mode. The UI orientation obviously rotated to landscape. Keep the device in portrait (since the controller is forced to landscape, the UI will still show a landscape UI eventhough the device is in portrait).
  3. Dismiss the modal controller. Now the main UI is in landscape mode. The problem is, this main UI is supporting all orientations (like stated above).
  4. After doing some interaction (without changing the device orientation), the device orientation suddenly back to portrait, but the UI does not follow suit.

Here's how the final screenshot: Statusbar and UI Orientation Mismatched

My current thought is that this is iOS bug. I want to look for another opinions regarding this bug. I've search around the net (bing and google) and found nothing.

1
did the view controller get presented while a device orientation change animation was in progress? if you present the view controller as a reaction to the user pressing some button on the UI, the answer is NO. if the view controller is presented as a reaction to some network event, the answer may be YES.Michael
The controller presented because the user tap a cell in table view (act as menu item). And then the view controller get presented while the device is in portrait mode. No rotation performed by user. All that steps above happen when the device is in portrait mode (only the UI changed because the presented controller is landscape only. The device still in portrait position from beginning till the end of steps above).Firanto

1 Answers

1
votes

I often saw this in apps, sometimes even in iOS itself (on homescreen etc)..

I think it's an iOS bug and we as developers can nothing do about it, just write bug reports.