我有一個圖像。我想旋轉就像一枚硬幣旋轉在表面上。我嘗試了旋轉變換,但它不像那樣旋轉。如何實現這樣的動畫?像硬幣一樣旋轉圖像
代碼:
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setUserInteractionEnabled:YES];
lbl_facebook.font=[UIFont fontWithName:GZFont size:12.0f];
txtPassword.font=[UIFont fontWithName:GZFont size:15.0f];
txtUsername.font=[UIFont fontWithName:GZFont size:15.0f];
CATransition* transition = [CATransition animation];
transition.startProgress = 0;
transition.endProgress = 1.0;
transition.type = @"flip";
transition.subtype = @"fromRight";
transition.duration = 0.3;
transition.repeatCount = 2;
[_Image.layer addAnimation:transition forKey:@"transition"];
}
ND:
#import "LoginViewController.h"
#import "RegistrationViewController.h"
#import "ForgetPasswordViewController.h"
#import "ForgetPasswordController.h"
#import "SearchServiceProviderViewController.h"
#import <QuartzCore/QuartzCore.h>
應用3D旋轉 –
嘗試是這樣的:http://stackoverflow.com/questions/6531332/how-to-rotate-an-uiimageview-with-catransform3drotate-make-an -effect-like-door-o – Radu
使用'CATransform3DRotate' –