Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to add multiple images with animation in UIImageview in iOS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 822
    Comment on it

    If you want to display the multiple images with animation in UIImageview then use the following code:

    Here you can also set the repeat count of the images.

    UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
    animatedImageView.animationImages = [NSArray arrayWithObjects:    
                                   [UIImage imageNamed:@"image1.gif"],
                                   [UIImage imageNamed:@"image2.gif"],
                                   [UIImage imageNamed:@"image3.gif"],
                                   [UIImage imageNamed:@"image4.gif"], nil];
    animatedImageView.animationDuration = 1.0f;
    animatedImageView.animationRepeatCount = 0;
    [animatedImageView startAnimating];
    [self.view addSubview: animatedImageView];

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: