Rotating a view within a navigation controller inside of a tab bar controller
I have an app with 4 tab bar entries, all but one holding a navigation controller, which then contains the stack of individual view controllers. How can I autorotate one of these view controllers?
Whenever I override the shouldRotateTo... method in one of these view controllers, the view controller will still never respond to autorotation events.
How can I make this work, preferably without having to tear apart my app in the process? Thanks in advance.
I have an app with 4 tab bar entries, all but one holding a navigation controller, which then contains the stack of individual view controllers. How can I autorotate one of these view controllers?
Whenever I override the shouldRotateTo... method in one of these view controllers, the view controller will still never respond to autorotation events.
How can I make this work, preferably without having to tear apart my app in the process? Thanks in advance.
To do this,
Subclass UITabBarController and override the shouldRotateTo... method.
This would do your trick...
Regards,
Akshay Shah.
__________________
If you think I did help you, you can always thank me by buying iHoldMore - A very nice and addictive game...
Need a mobile app. Contact Us. Ruby Solutions Pvt. Ltd.
You can mail me at akshay@ruby-solutions.com
Now, however, all of my views within the tab bar autorotate, when I only want one of them to do so. Can I fix this?
Just figured it out. In the subclass of the tab bar controller, in shouldAutorotate..., I check the class of the currently displayed VC. If it is a navigationController, I check its visible view controller's class, and if that is equal to the view controller that I want to autorotate, I allow autorotation. Otherwise, I don't.