如何在iphone应用程序中实现图像翻转动画
如何实现图像向右翻转动画。下面给出的代码。请帮忙如何在iphone应用程序中实现图像翻转动画,iphone,ios,animation,Iphone,Ios,Animation,如何实现图像向右翻转动画。下面给出的代码。请帮忙 imageview.animationImages=[NSArray arrayWithObjects: [UIImage imageNamed:@"image1.png"], [UIImage imageNamed:@"imag2.png"], [UIImage imageNamed:@"imag3.png"], [UIImage imageNamed:@"imag4.png"], [UIImage image
imageview.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"imag2.png"],
[UIImage imageNamed:@"imag3.png"],
[UIImage imageNamed:@"imag4.png"],
[UIImage imageNamed:@"imag5.png"],
[UIImage imageNamed:@"imag6.png"],
[UIImage imageNamed:@"imag7.png"], nil];
imageview.animationDuration=15.0;
imageview.animationRepeatCount=0;
[imageview startAnimating];
我想这段代码可能会对您有所帮助。用于垂直翻转
[UIView animateWithDuration:1.0 animations:^{
yourView.layer.transform = CATransform3DMakeRotation(M_PI,1.0,0.0,0.0);
} completion:^(BOOL finished){
// code to be executed when flip is completed
}];
水平翻转
[UIView animateWithDuration:1.0 animations:^{
yourView.layer.transform = CATransform3DMakeRotation(M_PI,0.0,1.0,0.0);
} completion:^(BOOL finished){
// code to be executed when flip is completed
}];
不要忘记将QuartzCore框架添加到项目中并导入
#import <QuartzCore/QuartzCore.h>
#导入
你做的方式有什么问题吗?@Will:这只是一个简单的动画。如何将图像一个接一个地向右翻转?@nila图像应该如何将其像并排翻转(垂直滚动)或像视图控制器一样翻转。?检查此链接您需要什么我认为它适合您我尝试了此代码。但我有一个错误。这是由于ios 4.0造成的吗?这应该可以在ios 4.0或更高版本上运行,到底会出现什么错误?架构i386的未定义符号:“\u CATTransferm3dMakeRotation”,引用自:\uuuuuuuuuu-[homeViewController viewDidLoad]\uBlock\u invoke\u1 in homeViewController.o ld:symbol未找到架构i386 collect2:ld返回1退出状态包括QuartzCore头文件,您还必须右键单击“框架”,选择“添加现有框架”并添加“QuartzCore.framework”。
#import <QuartzCore/QuartzCore.h>