开发者

UIView disappears after orientation change

I have the current problem: From an NSObject i'm creating / loading and animating a view:

[UIView beginAnimations:@"slidein" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:U开发者_C百科IViewAnimationCurveEaseInOut];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];


[content.view setAlpha:1.0];
for (UIView *view in content.view.subviews) {
    [view setAlpha:1];
}
[content.view setFrame:CGRectMake(0, 0, self.contentEnclosure.size.width, self.contentEnclosure.size.height)];


[UIView commitAnimations];

My problem is that, when orientation changes, my animated view disappears. If i make my view appear again, the orientation settings (frame size) are correct, so i'm guessing, that the resizing mask is applied correctly, i just don't understand what needs to be done, for my view not to disappear.


Use NSLog and check the new self.view.frame.origin.x and y respectively after the orientation.

Then set the frame according to the requirement.

Also, check for resizing mask. Try using UIViewAutoresizingFlexibleRightMargin/LeftMargin to suit your requirements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜