views:

216

answers:

1

I've recently added landscape autorotation to my iPhone navigation based application, however I'm having a bizarre issue which I have no idea how to fix or whether my code is even the cuplrit. Its bizarre because I'm implementing everything as per the autorotation docs on Apple's developer center (that is responding to shouldAutorotateToBlaBla and making sure my views autoadjust correctly).

The problem is that while pushing view controllers animates correctly, popping them off causing the animation to sometimes shift 20px then animate UP the screen, not from right to left relative to the current rotation.

In other words, when you hit Back in a landscape view controller, instead of animating to the right off the screen, it animates vertically down as if it was in Portrait orientation.

Any clues?

+1  A: 

I had this bug, but fixed it by implementing this UIViewController method in every view controller I had.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return interfaceOrientation == UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
}
Thanks, I'll give it a go and see if it fixes the issue.
Nick Bedford