第二个UIView动画(从左到右)

时间:2013-09-24 06:35:48

标签: ios objective-c xcode uiview core-animation

你好向我向右滑动时调用的第二个动画有一点问题。有两种方法:

- (void)hideView
{
    CGRect rect = self.overView.frame;
    [UIView beginAnimations:@"HideView" context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:1];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
    rect.origin.x = -768;
    self.overView.frame = rect;
    [UIView commitAnimations];
}



- (void)showView
    {
        CGRect rect = self.overView.frame;
        [UIView beginAnimations:@"ShowView" context:nil];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDuration:2];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
        rect.origin.x = 0;
        self.overView.frame = rect;
        [UIView commitAnimations];
    }

hideView工作正常,但我注意到动画结束时级别消失了(你可以看看我是否更改了rect.origin.x)也许这是问题,但不明白为什么会消失

0 个答案:

没有答案