UIView not displaying in landscape
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 adv开发者_如何学编程ance!
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.
Solved... I had to put the commitAnimations part above the addSubview:newView
Hope this helps everyone with the same issue....
精彩评论