2

I have an application with a UISplitViewController as the root controller. In the master side of the controller is the standard UINavigationController with UITableControllers inside. In the detail side is just a simple UIWebView.

I can get my UINavigationController to start exibiting some weird behavior after doing the following:

  1. Rotate portrait
  2. Bring up the master view by clicking my UIBarButtonItem
  3. Navigate around in the master view by going into the nav tree and popping back out
  4. Rotate to landscape
  5. Navigate around in the master view just as before

When the UINavigationController is popped in step 5, the animated is all jacked up. The whole screen animates vertically down, instead of the the UINavigationController animating as usual. It seems to be very related to the UISplitController and rotation.

Anyone heard of this issue or know a workaround? I dont't think I'm doing anything advanced here. If I disable the animation of the UINavigationController, all works as usual, but I don't want to do that since the animation looks pretty slick when working properly.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • 1
    I had a somewhat related problem some time ago, maybe it could be helpful? http://stackoverflow.com/questions/3190161/uinavigationcontroller-not-popping-uinavigationbar-items-on-ipad – filipe Dec 16 '10 at 21:10
  • Yeah, I don't know if want to override the default UINavigationController button to fix this. I would almost just rather turn off the animation. I will keep digging on this. – jonathanpeppers Dec 16 '10 at 21:14
  • After digging through your post, I saw where someone implemented ShouldAutoRotateToInterfaceOrientation to fix this. This solved my problem when I implemented this in all my UINavigationControllers. Thanks. – jonathanpeppers Dec 16 '10 at 21:34

1 Answers1

4

To fix this issue you need to implement ShouldAutoRotateToInterfaceOrientation in all UINavigationControllers.

It is only an issue on iPad for some reason. EDIT: my case only failed on iPad, so this may not be true in other cases.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • It is not only an issue on iPad. I've had it happen to me on an iPhone too. – ughoavgfhw Dec 17 '10 at 22:17
  • What do you mean by "implement ShouldAutoRotateToInterfaceOrientation in all UINavigationControllers" - In all _UIViewControllers_ ? In all delegates of UINavigationControllers? Or actually subclass UINavigationController and implement ShouldAutoRotateToInterfaceOrientation? Thanks – Oded Ben Dov Mar 19 '14 at 23:20
  • This post is old (for iOS versions lower than 6), but you used to have to do this on the controller. Now (iOS 6 and higher), you override `GetSupportedInterfaceOrientations`. – jonathanpeppers Mar 20 '14 at 20:42