我有 50 个圆形图像(progress-1.png、progress-2.png 等)代表一个圆的进度。如果我想出一个百分比值,我如何为一组的背景图像设置动画以显示该百分比值的进度?
最佳答案
你可以这样使用:
// Using a fixed percentage for this example
CGFloat percentage = 0.5f;
NSUInteger totalImages = 50;
NSUInteger imageCount = (totalImages * percentage);
[self.interfaceImage setImageNamed:@"progress-"];
[self.interfaceImage startAnimatingWithImagesInRange:NSMakeRange(0, imageCount)
duration:1.0
repeatCount:1];
关于swift - 如何在 Apple WatchKit 中设置循环进度动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30039160/