gpt4 book ai didi

ios - 接收用户交互的滚轮动画

转载 作者:行者123 更新时间:2023-11-28 20:05:30 25 4
gpt4 key购买 nike

UI 动画很棒,非常易于使用,并且被广泛使用。我遇到的唯一一个问题是,当动画在移动时, View 没有接收到任何用户交互。

例如,如果有一个 UIButton 每次显示时都会进行动画处理,但在动画结束之前用户无法点击它。

//这是一个 UIButton:

- (void)animationApear
{
CGRect frameSelf = self.frame;
frameSelf.origin.y -= frameSelf.size.height;

[UIView animateWithDuration:1.0 delay:0
usingSpringWithDamping:0.8 initialSpringVelocity:0
options:0
animations:^{

[self setFrame:frameSelf];

} completion:nil];
}

有什么办法可以解决这个问题吗?

谢谢!

最佳答案

您需要提供选项 UIViewAnimationOptionAllowUserInteraction

关于ios - 接收用户交互的滚轮动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22228953/

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