【发布时间】:2012-04-17 15:58:03
【问题描述】:
我对 iOS 动画很陌生,我想知道是否可以使用 CGAffineTransform 将两个图像之间的过渡与 UIImageView 的翻译动画结合起来?
换句话说,我想要在两张图像之间制作动画,然后我想应用同声翻译,以便整个内容在页面上移动,同时在两张图像之间来回移动。
我知道我可以应用 CGAffineTransformConcat 来组合两个 CGAffineTransform,例如 CGAffineTransformTranslate 和其他东西。但我没有看到允许我转换到另一个 UIImage 的 CGAffineTransform。
我知道在图像之间制作动画的唯一方法是将 UIImageView animationImages 数组与 startAnimating 结合使用。但是,我不知道如何将它与这样的翻译结合起来:
UIImageView* textView = [[UIImageView alloc] initWithFrame:bunnyImage.frame];
textView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"bunnyclose.png"],
[UIImage imageNamed:@"bunnytalk.png"],
nil];
textView.animationDuration = 1.0;
textView.animationRepeatCount = 8;
[textView startAnimating];
[self.view addSubview:textView];
有什么建议吗?
【问题讨论】:
标签: animation ios5 uiimageview uiimage cgaffinetransform