我正在尝试创建一个基本的iOS
应用程序,只有HTML知识。
我添加了一个代码动画中找到的代码,但动画的尺寸和位置是错误的。这是代码:
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];
}
有人能帮助我吗?
答案 0 :(得分:1)
您所要做的就是更改CGRectMake()
中的坐标。
CGRectMake(x, y, width, height)