gpt4 book ai didi

iphone - 如何获取动画结束通知

转载 作者:可可西里 更新时间:2023-11-01 05:01:34 26 4
gpt4 key购买 nike

我想在动画结束后做一些 Action 。

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.80f];
self.view.transform =
CGAffineTransformMakeTranslation(
self.view.frame.origin.x,
480.0f + (self.view.frame.size.height/2) // move the whole view offscreen
);
[self.view setAlpha:0];
[UIView commitAnimations];

我已经像上面那样做了动画,如何找出动画结束,以便我可以在之后做我的 Action 。

最佳答案

使用这个:

    [UIView animateWithDuration:0.80f animations:^{
self.view.transform =
CGAffineTransformMakeTranslation(
self.view.frame.origin.x,
480.0f + (self.view.frame.size.height/2) // move the whole view offscreen
);
[self.view setAlpha:0];
}
completion:^(BOOL finished){
// your code
}];

关于iphone - 如何获取动画结束通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11985321/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com