views:

34

answers:

2

Hi,

I have a window with a UIView and a transition to another UIView. But when I do the transition, the window to transition to is displayed in portrait, and after the transition is finished, it goes to landscape.. But I want the UIView to be in landscape BEFORE the transition because otherwise the screen looks f*cked up because the background image is made for landscape mode. Here is my code:

UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:window cache:YES];

[[oldView view] removeFromSuperview];
[window addSubview:newView.view];

[UIView commitAnimations];

The orientation property of the newWindow is set to landscape in the interface builder, and also in the superview...

What am I doing wrong??

Thanks in advance!

A: 

First of all, you should not use multiple window, it will never give you the result you are expecting... You can easily do the same thing with one window and 2 UIViews.

TheSquad
I use 1 window and 2 UIViews, sorry for the error in my example code I ajusted it.. But how can I fix the issue then??
CyberK
A: 

Solved... I had to put the commitAnimations part above the addSubview:newView

Hope this helps everyone with the same issue....

CyberK