views:

26

answers:

1

I dealt with orientation by register as an observer, and rotate the navigationController's view to the desired orientation. But some view controllers deal with orientation changes by the following methods.

Responding to View Rotation Events

  • willRotateToInterfaceOrientation:duration:
  • willAnimateRotationToInterfaceOrientation:duration:
  • didRotateFromInterfaceOrientation:
  • willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
  • didAnimateFirstHalfOfRotationToInterfaceOrientation:
  • willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:

Those methods will make the navigation bar's height become thinner under landscape orientation, and I don't want this behavior. I hope the height of navigation bar never change. How to achieve this?

A: 

I solve this problem by receiving the orientation change notifications at the root view controller, and then re-assign the size of navigation bar each time orientation change occurs. It works well not, but the official document discourage about setting frame, bounds properties to navigation bar.

Toro