I had an animation in a WKInterfaceImage
within a WKInterfaceTable
:
[[self.table setNumberOfRows:1 withRowType:@"Loading"];
WatchLoadingCell *cell = [self.table rowControllerAtIndex:0];
[cell.image setImageNamed:@"spin"];
[cell.image startAnimating];
My images are named spin0
- spin30
and are added to the watchKit App target.
when the app runs, the image is static, i.e only showing spin0
any ideas why?
EDIT: it works in the simulator, but not on the device itself, it works on the device only when I reload the view by calling [self awakeWithContext:nil];
from my Force Touch menu
I have also tried starting the animation in willActivate
with no luck
When setting animation images in code, you should use startAnimatingWithImagesInRange:duration:repeatCount: method
[cell.image setImageNamed:@"spin"];
[cell.image startAnimatingWithImagesInRange:NSMakeRange(0, 30) duration:10 repeatCount:0];
If you call startAnimating method, duration set in IB will be used
IB-screenshot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With