UIImageView to show application download progress

I have a launch screen containing the application logo, say test . When the application starts loading, the logo will gradually begin to fill up, like this . In the end, when the application is fully downloaded, it will look like this .

One point that I would like to mention here is that the color fills from left to right. And there will be no color. It contains different colors for different characters.

After searching on Google, I find out that I need to use two images of a fully-filled image with red color and the other without color, one on top of the other and apply animation on it. So far I have done this, but could not revive it from left to right.

I need to use this functionality in android as well. Can anyone suggest?

+6
source share
2 answers

You have two images, filled and filled, superimposed on each other. Change the width of the filled image on the fly depending on the progress.

 static int max_image_width = 250 // assumption UIImage * blankImage;  UIImage * filledImage;  - (void) viewDidAppear: (BOOL) animated {[super viewDidAppear: animated];  [self fillImage: 1];  / * any value between 0 and 1 * /} - (void) fillImage: (CGFloat) progress {CGFloat image_width = max_image_width * progress;  [UIView animateWithDuration: 2 animations: ^ {CGRect frame = self.filledImage.frame;  frame.size.width = image_width;  self.filledImage.frame = frame;  }];  } 
+2
source

Here you can use sprite sheet animation in your iOS application, you can get an example here http://www.icodeblog.com/2009/07/24/iphone-programming-tutorial-animating-a-game-sprite/ OR you can use GIF Image code support here https://github.com/arturogutierrez/Animated-GIF-iPhone and here fooobar.com/questions/89684 / ... (SO's own answer)

I would be glad to hear what you are trying to implement.

+1
source

Source: https://habr.com/ru/post/958304/


All Articles