作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要为一系列图像制作动画。
// Animate Circle
let duration = 1.0
circleGroup.setBackgroundImageNamed("arc")
circleGroup.startAnimatingWithImagesInRange(NSRange(location: 0, length: 100), duration: duration, repeatCount: 0)
我有 101 张图片。从 arc0 到 arc100。
Storyboard:
正如您在 gif 上看到的,我的问题是动画没有完成完整的循环。有什么建议吗?
最佳答案
看起来动画刚过 40% 就停止了。我打开 Assets 库并将每个文件重命名为完全相同的名称。然后我打开我的 Git 客户端,我看到了这个变化:
动画现在可以工作了。如您所见,问题出在文件名中,其中有多余的空间。
我还了解到,当执行反向动画时,location
不是起点而是目的地。
关于swift - startAnimatingWithImagesInRange 未完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38723495/
我需要为一系列图像制作动画。 // Animate Circle let duration = 1.0 circleGroup.setBackgroundImageNamed("arc") circl
我正在开发 Apple Watch 应用程序。在应用程序中,我有带动画的进度条。我正在使用 - (void)startAnimatingWithImagesInRange:(NSRange)ima
我是一名优秀的程序员,十分优秀!