0

Summery:

  1. I have a custom UITabBarAutoRotateController which returns YES from shouldAutorotateToInterfaceOrientation. This has no effect.
  2. If I minimize and show the app again, the rotation issue goes away.
  3. How do I refresh the screen so the user does not have to do this (so rotation works again)?

Details (setup graphically, so no code):

I have two UITabBarController in MainWindow.xib. I only want one to show at a time. So I am linking graphically rootViewController = tabBarController_name1. There is also tabBarController_name2.

I will also have an alert MessageBox for a user to choose what type of application they need, and it will choose a tab bar controller based on their request (per customer definition). This is commented out for now.

There is a bug with Rotation when two UITabBarControllers exist on the same xib. When I try to rotate the screen, it stays upward with wherever the main screen button (power button looking button) faces. HandleOrientationChange does not get called on the active custom ViewController being shown.

The reason I believe it's a bug is because if I hit the main screen button (minimizing the application), and click back on the application (brings it back to the foreground), rotation works perfectly!

Sorry for making you read all that mumbo :). My true question is, "Is there anyway I could refresh the main window or likewise UITabBarController's to get rotation working (without requiring the program be minimized and shown)"? A work-around, if you will?

p.s. I cannot use Storyboard for backwards compatibility reasons. The customer will be receiving this code/project. So I would like to keep this in one graphical page, rather than hiding/showing UITabBarItem's.

EDIT: two-uitabbarcontrollers-and-autorotation and uitabbarcontrollers-and-uinavigationcontrollers were both helpful, but did not address "why" this issue happens. "noob" here when it comes to xcode :)

Community
  • 1
  • 1
TamusJRoyce
  • 817
  • 1
  • 12
  • 25
  • My idea right now is to use a UINavigationController and hiding the navigation panel at the top (so the customer can easily see where the navigation is happening). Each UITabViewController would exist under separate navigation items. I'm still learning tutorials on it. Would this be the best way to solve this problem? – TamusJRoyce Jan 08 '12 at 05:23

1 Answers1

0

Tab bar controller inside a navigation controller, or sharing a navigation root view is the answer. Do not use a TabBarViewController. Which, as a noob, I'm not quite sure why TabBarViewController exists (or at least isn't depreciated).

Dragging two TabBarViewControllers into the same page should result in a warning saying that you probably want to implement TabBarViewController by making a custom UIViewController and attaching a plain UITabBar to it.

Frustrating...but finally making progress :)

Community
  • 1
  • 1
TamusJRoyce
  • 817
  • 1
  • 12
  • 25