gpt4 book ai didi

image - 通过在自定义单元格内进行修饰来制作基本的动画/翻译

转载 作者:行者123 更新时间:2023-11-30 14:06:03 26 4
gpt4 key购买 nike

我想将基本动画应用于自定义单元格中的某些元素,例如标签、图像:特别是,我想让这些动画在我触摸单元格内部时也启动。我是初学者,我只学会了使用 animateWithDuration 和 transitionByView:是否可以用它们添加我的目标?

最佳答案

在您的自定义单元格类中覆盖touchesEnded事件并将动画放入其中

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];

[UIView animateWithDuration:1.0 animations:^{
// your code
}];
}

这将在您期望 touchUpInside 发生的同时触发

关于image - 通过在自定义单元格内进行修饰来制作基本的动画/翻译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32380700/

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