我希望 iPhone 应用程序中的图像能够“弹出”在屏幕上,而不仅仅是出现。我所说的“弹出”是指它会从小点增长到实际大小。作为参考,这与 Keynote 中的“pop”动画效果完全相同。
我对 iOS 动画完全陌生,所以如果有人能指出我需要使用的动画效果的方向,我将不胜感激。
Thanks
Brian
UPDATE我从下面的建议中添加了这段代码。这可行,但它会缩小而不是放大我的图像。我知道这是因为我的变换比例大小为 0.01,但我想知道如何从大小为 0.0 的图像开始并放大到 1。将图像的大小设置为0?
谢谢
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration: 0.2];
image.transform = CGAffineTransformMakeScale(0.01, 0.01);
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
您正在寻找的效果是这样的:
// instantaneously make the image view small (scaled to 1% of its actual size)
view.transform = CGAffineTransformMakeScale(0.01, 0.01);
[UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
// animate it to the identity transform (100% scale)
view.transform = CGAffineTransformIdentity;
} completion:^(BOOL finished){
// if you want to do something once the animation finishes, put it here
}];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)