Chris Daniels
Chris Daniels

Reputation: 5

Change image sizes in NSArray Function - XCode

I'm trying to create myself a basic iOS app with nothing but HTML knowledge.

I added a code I found for an in-App animation but the animation's dimensions and placement are wrong. Here is the code:

 NSArray *imageNames = @[@"fold1.png", @"fold2.png", @"fold3.png", @"fold4.png",
                        @"fold5.png", @"fold6.png", @"fold7.png", @"fold8.png",
                        @"fold9.png", @"fold10.png", @"fold11.png", @"fold12.png",
                        @"foldclear.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;
animationImageView.animationRepeatCount = 1;

[self.view addSubview:animationImageView];
[animationImageView startAnimating];

}

Can anybody help me?

Upvotes: 0

Views: 59

Answers (1)

Dani
Dani

Reputation: 1288

All you have to do is to change the coordinates in CGRectMake().

CGRectMake(x, y, width, height)

Upvotes: 1

Related Questions