gpt4 book ai didi

swift - startAnimatingWithImagesInRange 未完成

转载 作者:行者123 更新时间:2023-11-28 08:31:48 28 4
gpt4 key购买 nike

我需要为一系列图像制作动画。

// Animate Circle
let duration = 1.0
circleGroup.setBackgroundImageNamed("arc")
circleGroup.startAnimatingWithImagesInRange(NSRange(location: 0, length: 100), duration: duration, repeatCount: 0)

gif animation shows animated circle which animates from 0% to 45% of its radius

我有 101 张图片。从 arc0arc100。

Xcode screenshot with images in the folder.

Storyboard:

storyboard with the watch app UI

正如您在 gif 上看到的,我的问题是动画没有完成完整的循环。有什么建议吗?

最佳答案

看起来动画刚过 40% 就停止了。我打开 Assets 库并将每个文件重命名为完全相同的名称。然后我打开我的 Git 客户端,我看到了这个变化:

动画现在可以工作了。如您所见,问题出在文件名中,其中有多余的空间。

我还了解到,当执行反向动画时,location 不是起点而是目的地。

关于swift - startAnimatingWithImagesInRange 未完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38723495/

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