這里的這個(gè)動(dòng)畫什么好說的巧还,直接看代碼:
//橫向、縱向移動(dòng)
[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.alpha = !_aView.alpha;
}];
//翻頁效果
[UIView beginAnimations:nil context:nil];//開始動(dòng)畫的配置
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];//動(dòng)畫的『節(jié)奏』
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:_aView cache:NO];
[UIView commitAnimations];//動(dòng)畫配置完畢,提交動(dòng)畫
//旋轉(zhuǎn)
[UIView animateWithDuration:0.5 animations:^{
//只能做一次
// _aView.transform = CGAffineTransformMakeRotation(M_PI);
//能多次
_aView.transform = CGAffineTransformRotate(_aView.transform, M_PI_4);
}];
//放大效果
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformMakeScale(2, 2);
}];
//縮小
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformScale(_aView.transform, 0.7, 0.7);
}];
//平移
[UIView animateWithDuration:0.5 animations:^{
_aView.transform = CGAffineTransformTranslate(_aView.transform, 10, 10);
}];