I’m trying to create an animated UIImageView with certain image constraints.
I want the UIImageView animating at a size of 141×262, and not the entire screen. Currently I have this code:
CJ = [[UIImageView alloc] initWithFrame:self.view.frame];
CJ.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"CJ_1.png"],
[UIImage imageNamed:@"CJ_2.png"],
[UIImage imageNamed:@"CJ_3.png"], nil];
CJ.animationDuration = 1;
CJ.animationRepeatCount = 0;
[CJ startAnimating];
[self.view addSubview:CJ];
Any and all help will be appreciated!
If you want the view to be a different size, set its frame to be that size:
If your images are large, you probably also want to set a contentMode on your view. For example: