标签:
1.block式动画
横向或纵向移动XY
[UIView animateWithDuration:0.5 animations:^{
self.aView.frame = CGRectMake(_aView.frame.origin.x, _aView.frame.origin.y + 50, _aView.frame.size.width, _aView.frame.size.height);
}];
或者
[UIView animateWithDuration:0.5 animations:^{
//_aView.transform = CGAffineTransformMakeTranslation(0, 20);
_aView.transform = CGAffineTransformTranslate(_aView.transform, 10, 10);
}];
渐变效果
[UIView animateWithDuration:0.5 animations:^{
_aView.alpha = !_aView.alpha;
}];
2.头尾式动画 ---翻页效果
[UIView beginAnimations:nil context:nil] 开始配置动画
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:_aview cache:NO];
[UIView commitAnimations] 配置完毕,提交动画
旋转效果
旋转一次
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformMakeRotation(M_PI);
}];
旋转多次
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformRotate(_aView.transform, M_PI_4);
}];
放大效果
[UIView animateWithDuration:0.2 animations:^{
//_aView.transform = CGAffineTransformMakeScale(2, 2);
_aView.transform = CGAffineTransformScale(_aView.transform, 1.1, 1.1);
}];
缩小
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformMakeScale(0.5, 0.5);
}];
还原
_PinkView.transform = CGAffineTransformIdentity;
标签:
原文地址:http://www.cnblogs.com/yangqinglong/p/5158495.html