/// 左右翻转
- (void)animFlipFromLeft {
[UIView beginAnimations:@"flipleft" context:nil];
//设置时常
[UIView setAnimationDuration:1];
//设置动画淡入淡出
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//设置翻转方向
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self
cache:YES];
[UIView commitAnimations];
}
- (void)animFlipFromRight {
[UIView beginAnimations:@"flipright" context:nil];
//设置时常
[UIView setAnimationDuration:1];
//设置动画淡入淡出
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
//设置翻转方向
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:self
cache:YES];
[UIView commitAnimations];
}
/// 旋转
- (void)animRotate:(int)angle {
CGAffineTransform transform;
transform = CGAffineTransformRotate(self.transform,M_PI/360 * angle);
[UIView beginAnimations:@"rotate" context:nil ];
[UIView setAnimationDuration:2];
[self setTransform:transform];
[UIView commitAnimations];
}
/// 移动
- (void)animMove:(CGRect)rc {
[UIView beginAnimations:@"move" context:nil];
[UIView setAnimationDuration:2];
self.frame=rc;
[UIView commitAnimations];
}
/// 翻页
- (void)animCurlUp {[UIView beginAnimations:@"curlUp" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//指定动画曲线类型
[UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp
forView:self
cache:YES];
[UIView commitAnimations];
}
/// 缩放
- (void)animScale {
CGAffineTransform transform;
transform = CGAffineTransformScale(self.transform,1.2,1.2);
[UIView beginAnimations:@"scale" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
[self setTransform:transform];
[UIView commitAnimations];
}