【发布时间】:2014-06-07 01:31:26
【问题描述】:
我的动画运行良好的代码。问题是我希望整个动画移动到屏幕的左侧,然后停止并重新开始。基本上它是一只熊动画,但我需要整个动画在屏幕上向左移动。我不希望它以不同的方式制作动画,我只需要改变它的 x 值,但我被卡住了。有人可以帮忙吗。这是我到目前为止所拥有的。
- (void)viewDidLoad
{
[超级viewDidLoad];
NSArray *imageNames = @[@"bear1.gif", @"bear2.gif", @"bear3.gif", @"bear4.gif",
@"bear5.gif", @"bear6.gif"];
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, 50, 50)]; animationImageView.animationImages = 图像; animationImageView.animationDuration = 0.5;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
// Do any additional setup after loading the view, typically from a nib.
}
【问题讨论】:
标签: ios objective-c animation uiimageview