Fabio
Fabio

Reputation: 1973

Move UIImage around the screen

I have this code:

UIImageView *_propLoading;

- (void)viewDidLoad
{
    UIImage *image = [UIImage animatedImageNamed:@"loading" duration:.8f];
    [_propLoading setImage:image];
}

This works perfectly, but i need move around screen at the same time

i try this code but not works.

-(void)viewDidAppear:(BOOL)animated{

    [UIView animateWithDuration:2
                          delay:0
                        options:UIViewAnimationOptionCurveEaseIn
                     animations:^{
                         _propLoading.frame = CGRectMake(22, 33, 134, 232);
                     }
                     completion:^(BOOL finished){


                     }];
}

Upvotes: 0

Views: 361

Answers (1)

StevenOjo
StevenOjo

Reputation: 2488

Try:

[UIView transitionWithView:_propLoading
                duration:2.0f
               options:UIViewAnimationOptionTransitionCrossDissolve
            animations:^{
                _propLoading.frame = CGRectMake(22, 33, 134, 232);
                [_propLoading setImage:image];
            } completion:NULL];

Upvotes: 2

Related Questions