Search code examples
iosxcodeuitabbarcontrollergalleryuiinterfaceorientation

IOS - UIViewController won't rotate


I have a UITabbar inside a UINavigationController base app. On one off the tabs I've some tumbnails of photos, and when I tap on one of the photos, I go to another UIViewController (push to the nav stack) and have the photos in Fullscreen.

I have two problems with that:

1- I can't rotate, or even make a NSLog of the rotation. I have the shouldAutorotateToInterfaceOrientation returning YES, and i've tried the didRotateFromInterfaceOrientation and willRotateToInterfaceOrientation methods, with a simple NSLog, but it doesn't worked at all.

2- When I hit the back button, and come back to the tab of thumbnails, I still have these thumbnails, but i don't have the tabbar any more.


Solution

  • I will just throw my two cents:

    When you are using a UITabBar application, all UIViewController's should allow rotation in order for you to rotate one of them. Although there are some workarounds for this behavior, you can check this answer and this article.