【问题标题】:How to animate circular progress in Apple WatchKit?如何在 Apple WatchKit 中为循环进度设置动画?
【发布时间】:2015-05-04 20:15:31
【问题描述】:

我有 50 个圆形图像(progress-1.png、progress-2.png 等)代表一个圆圈的进度。如果我想出一个百分比值,如何为组的背景图像设置动画以显示该百分比值的进度?

【问题讨论】:

标签: swift ios8 xcode6 watchkit apple-watch


【解决方案1】:

你可以这样使用:

// 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];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-27
    • 2019-04-03
    • 2015-03-23
    • 2016-02-24
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多