tomidelucca
tomidelucca

Reputation: 2543

Animating images in Watch OS2 not working

I'm trying to animate the background image of a WKInterfaceGroup without success. I know this is something easy and shouldn't take to much to do it, but I still can't make the images animate.

I have six images loaded in the assets, named loading1 ~ loading 6.

I have the group set in IB, and have an outlet defined in my WKInterfaceController.

The code I'm using is the following:

    // Defined outlet from IB    
@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceGroup *mainGroup;

...

[self.mainGroup setBackgroundImageNamed:@"loading1"];

NSRange range = {1,6};
[self.mainGroup startAnimatingWithImagesInRange:range duration:0.5f repeatCount:0];

This does nothing. No image is shown. If I remove the startAnimatingImagesInRange:duration:repeatCount: method call, the image loading1 is shown but, as expected, it doesn't animate.

I've tried also setting the animation in IB and calling startAnimating from code but it still has the same behaviour (when calling startAnimating the image disappears).

NOTE: I'm trying this in the simulator as I still don't have a Watch (do you think this might be the issue?).

Upvotes: 1

Views: 586

Answers (1)

Kosuke Ogawa
Kosuke Ogawa

Reputation: 7451

Change

[self.mainGroup setBackgroundImageNamed:@"loading1"];

to

[self.mainGroup setBackgroundImageNamed:@"loading"];

Upvotes: 4

Related Questions