How can I implement image flip animation towards right. the code given below. plz help .
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];
for vertical flip
[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
}];
for horizontal flip
[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
}];
and don't forget to add QuartzCore framework to the project and importing
#import <QuartzCore/QuartzCore.h>
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:imageview cache:NO];
[UIView commitAnimations];
I think This code may help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With