5

右方向への画像反転アニメーションを実装するにはどうすればよいですか。以下のコード。plzヘルプ。

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];
4

2 に答える 2

9

垂直フリップ用

[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>
于 2012-12-05T04:44:26.440 に答える
2
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:imageview cache:NO];
[UIView commitAnimations];

このコードはあなたを助けるかもしれないと思います。

于 2012-12-05T04:35:06.653 に答える