UIView的,翻转、旋转,偏移,翻页,缩放,取反的动画效果
翻转的动画
-
- [UIView beginAnimations:@"doflip" context:nil];
-
- [UIView setAnimationDuration:1];
-
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
-
- [UIView setAnimationDelegate:self];
-
- [UIView setAnimationTransition:
- UIViewAnimationTransitionFlipFromLeft forView:manImageView cache:YES];
-
- [UIView commitAnimations];
旋转动画
-
- CGAffineTransform transform;
-
- transform = CGAffineTransformRotate(manImageView.transform,M_PI/6.0);
-
- [UIView beginAnimations:@"rotate" context:nil ];
-
- [UIView setAnimationDuration:2];
-
- [UIView setAnimationDelegate:self];
-
- [manImageView setTransform:transform];
-
- [UIView commitAnimations];
偏移动画
[UIView beginAnimations:@"move" context:nil];
[UIView setAnimationDuration:2];
[UIView setAnimationDelegate:self];
//改变它的frame的x,y的值
manImageView.frame=CGRectMake(100,100, 120,100);
[UIView commitAnimations];
翻页动画
- [UIView beginAnimations:@"curlUp" context:nil];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
-
- [UIView setAnimationDuration:1];
- [UIView setAnimationDelegate:self];
-
- [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:manImageView cache:YES];
-
- [UIView commitAnimations];
缩放动画
- CGAffineTransform transform;
- transform = CGAffineTransformScale(manImageView.transform,1.2,1.2);
- [UIView beginAnimations:@"scale" context:nil];
- [UIView setAnimationDuration:2];
- [UIView setAnimationDelegate:self];
- [manImageView setTransform:transform];
- [UIView commitAnimations];
取反的动画效果是根据当前的动画取他的相反的动画
- CGAffineTransform transform;
- transform=CGAffineTransformInvert(manImageView.transform);
-
- [UIView beginAnimations:@"Invert" context:nil];
- [UIView setAnimationDuration:2];
- [UIView setAnimationDelegate:self];
- [manImageView setTransform:transform];
- [UIView commitAnimations];