Question

I'm using a custom created loading spinner for my iOS app, but the edges looks rough on a coloured background as expected from a GIF.

How do other apps handle this situation? Do they use anything other than GIF, maybe APNG or something? Cause with GIF, the edges are always going to be rough, if matte is used, it would look good on just one color and not the others.

Any solution?

Was it helpful?

Solution

The UIImageView class provides the easiest way for developers to implement animations. All you need to do is to create an UIImageView object with a series of images for animating.

Example

// Load images
NSArray *imageNames = @[@"win_1.png", @"win_2.png", @"win_3.png"];

NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i = 0; i < imageNames.count; i++) {
    [images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}

// Normal Animation
UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(60, 95, 86, 193)];
animationImageView.animationImages = images;
animationImageView.animationDuration = 0.5;

[self.view addSubview:animationImageView];
[animationImageView startAnimating];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top