Container controllers and iOS 6 rotations

My app supports portrait, landscape left and lansdscape right orientation, but in some places of the app I only support portrait.

Making the iOS 6 adaptation I have a problem. I show a modal controller inside a UINavigationController, and the root controller has the rotation methods implemented but never being called because new rotation behaviors with controllers that are inside of a container one.

My question has a quick response: if I have a controller which does not support all app orientations, and that controller is inside a container controller, do I have to subclass that container (in my case the navigation) to override rotation methods and accomplish my target?

I think that is very tricky but I don't find another solution.

Thank you


There are several "pseudo official" source that subclassing a container class, specifically the UINavigationController is the way to go to achieve orientation task.

Here are some links to Apple developers forum with corporate answers stating this:

  • https://devforums.apple.com/message/740014#740014
  • https://devforums.apple.com/message/744384#744384
  • The category method used by many developers is not correct, see thread#message 728805#728805 (can't post more than two links)


    Yea. Subclass your UINavigationController and override the autorotation methods for portrait.

    链接地址: http://www.djcxy.com/p/54968.html

    上一篇: 为嵌入的UITabBar子视图设置不同的UINavigationController标题?

    下一篇: 容器控制器和iOS 6旋转