0

Possible Duplicate:
iOS bounds change after rotating to landscape, then back to portrait

I have an UIViewController that, depending on its orientation, switches the underlying xib from landscape to portrait and vice versa.

The mechanics for this is quite simple. In willRotateToInterfaceOrientation I check for the orientation we're changing to and I load the correct xib and call [self viewDidLoad].

The result is that all my views get the correct outlet and all the standard UI components look fine.

The problem arises with a custom component that I lay out again during rotation. Its problem is that when I read the frame of that component, the resulting frame in willRotateToInterfaceOrientation isn't the one expected to be in the new controller.. it's something in between the two, just like it was a frame of the animation.

Has this ever happened to anyone? Is there a better way to accomplish this?

Community
  • 1
  • 1
Valerio Santinelli
  • 1,582
  • 2
  • 29
  • 41

0 Answers0