gpt4 book ai didi

ios - 需要在ios中的didselectitematindexpath上摇动collectionviewcell

转载 作者:行者123 更新时间:2023-12-01 20:18:36 24 4
gpt4 key购买 nike

enter image description here

CAKeyframeAnimation * anim = [ CAKeyframeAnimation animationWithKeyPath:@"transform"] ;

anim.values = @[ [ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-10.0f, 0.0f, 0.0f) ], [ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(10.0f, 0.0f, 0.0f) ] ] ;
anim.autoreverses = YES;
anim.repeatCount = 2.0f;
anim.duration = 0.1f;

[cell.layer addAnimation:anim forKey:nil] ;

我编写上面的代码在选择时摇动 Collection View 单元格。当我在查看屏幕后第一次这样做时, Collection View 单元格的框架不匹配。虽然当我再次访问 View 时它工作正常。
请帮助我解释为什么它在添加动画后第一次创建问题,如果我删除动画那么第一次也没有不匹配但我需要触摸动画。

当我再次访问此 View 并执行部分时,没有框架不匹配。只有在第一次访问 View 时第一次选择有问题。

最佳答案

我得到了这个问题的解决方案,为什么 Collection View 单元格的框架不匹配。这是由于 ToastView 引起的。我正在通过 toast 显示超出图像消息。现在我使用警报 View ,它工作正常......

关于ios - 需要在ios中的didselectitematindexpath上摇动collectionviewcell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36081436/

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