我正在为我的iPhone应用程序创建基本动画。我有两种不同类型的动画可供选择。我可以用这...iPhone上的动画 - 使用图像序列或旋转?
NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"myImage1.png"], [UIImage imageNamed:@"myImage2.png"], [UIImage imageNamed:@"myImage3.png"], [UIImage imageNamed:@"myImage4.gif"], nil]; UIImageView *myAnimatedView = [UIImageView alloc]; [myAnimatedView initWithFrame:[self bounds]]; myAnimatedView.animationImages = myImages; myAnimatedView.animationDuration = 0.25; [self addSubview:myAnimatedView]; [myAnimatedView release];
或这样的事情...
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.5];
// other animations goes here
myImage.transform = CGAffineTransformMakeRotation(M_PI*0.5);
// other animations goes here
[UIView commitAnimations];
我有好几个,这些部件的动画,所以我要选择一个选项,使用最少量的内存并且最快速地运行。任何建议将是伟大的,谢谢
感谢您的领导,这真的很有用。你会认为使用一个小的PNG和平铺它会更好地使用一个更大的单个PNG? – user157733 2010-05-04 15:41:45