0

Simple question, hope there is a simple answer.

My scenario: iPhone app with NavigationController

  • Level 1: View with shouldAutoRotate..orientation=..Portrait (works)

  • Level 2: View with shouldAutoRotate..orientation=..Portrait (works)

When the iPhone is rotated, the views stay on portrait mode, perfect.

  • Level 3: View with shouldAutoRotate..TRUE (doesn't work on first load)

The first load of the view is in portrait independent of iPhone orientation and stays there, bad. After the view is ready, all rotations are recognized and work perfect.

Is there a way to tell the app "check your orientation now"? Several tricks I found didn't work (anymore) and the apple documentation seems less than helpful on this special topic.

So far the newest suggestion I found was to create a dummy view, show it and release it again, but I tried several places in the app and it didn't work. The view always gets stuck until you rotate the iphone manually. I would prefer a working example, so I can test it directly and see if it works before changing my code, but I'm also thankful for an explanation what to do if it works.

Thanks

//edit: As mentioned in one of the links this is considered a bug and not fixed by Apple, I worked around the problem replacing the NavigationController with own Controllers each with a Scrollview. Not very nice when you have all running and just need the rotation to work as expected, but works at least as expected. Thx to occulus for pointing in the right direction.

1 Answers1

0

Please see this question:

Transitioning to landscape rotation within a uinavigationcontroller

Also:

UINavigationController and autorotation

So a good strategy might be to use Modal dialogs.

Community
  • 1
  • 1
occulus
  • 16,959
  • 6
  • 53
  • 76
  • Sorry, but none of this worked for me, the view always gets stuck until you rotate. There's a lot of should and could suggestions, but none seems to really work, at least not in my project. Anyone figured this out? Maybe with a working to example? – Daniel Brown Mar 26 '11 at 01:21