【发布时间】:2011-09-06 01:28:20
【问题描述】:
我正在使用效果很好的 curlup 和 curldown 动画。我的问题是我的视图在它推动视图控制器之前仍然存在一秒钟。动画结束时如何隐藏当前视图?
【问题讨论】:
标签: ios4 iphone-sdk-3.0 core-animation cocos2d-iphone
我正在使用效果很好的 curlup 和 curldown 动画。我的问题是我的视图在它推动视图控制器之前仍然存在一秒钟。动画结束时如何隐藏当前视图?
【问题讨论】:
标签: ios4 iphone-sdk-3.0 core-animation cocos2d-iphone
希望这段代码对你有所帮助....
检查一遍.....
当您的动画完成时,“customView”帧大小设置为 (x,y,0,0).... 如下所示
-(void)close_but{
CGRect viewTopFrame = CGRectMake(150,240,0,0);
[UIView animateWithDuration:0.5
delay:0
options: UIViewAnimationCurveEaseOut
animations:^{
"customView".frame = viewTopFrame;
}
completion:^(BOOL finished){
NSLog(@"Done!");
}];
customView.frame=viewTopFrame;
【讨论】:
一旦动画完成,您可以将视图的 alpha 设置为 0,例如:
[customView setAlpha:0];
【讨论】: