创建动画
1.動畫(頭部-開始動畫)
[UIView beginAnimations:nil context:nil];2.設置動畫的執行時間
[UIView setAnimationDuration:1.0];3.向上移動// CGPoint tempCenter = _btn.center;
CGRect tempFrame = _btn.frame;tempFrame.origin.y -= 50;_btn.frame = tempFrame; 3.左旋轉45° (transfrom 變形,改造)//_btn.transfrom = CGAffineTransformMakeROtation(- M_PI_4);
_btn.transform = CGAffineTransformRotate(_btn.transform,- M_PI_4);4.變大//_btn.transform = CGAffineTransformMakeScale(1.2, 1.2);
_btn.transform = CGAffineTransformScale(_btn.transform, 1.2, 1.2);5.透明度 (0-1)
_ben.alpha = 1;6.動畫(尾巴-提交動畫-執行動畫)
[UIView commitAnimations];//清空之前所有的形變狀態(消除以前的旋轉、縮放等狀態)
_btn.transform = CGAffineTransformIdentity;方法二:
[UIView animateWithDuration:1.0 animations:^{rowView.frame = CGRectMake(0,20,100,40);rowView.alpha = 1;
}];[UIView animateWithDuration:1.0 animations:^{rowView.frame = CGRectMake(0,20,100,40);rowView.alpha = 1;
} completion:^(BOOL finished){ //動畫執行完畢后會自動調用這個block
NSLog(@“哈哈”);
}];
?
轉載于:https://www.cnblogs.com/ZhangYuGe/p/4145916.html
總結
- 上一篇: WebApi系列~自主宿主HttpSel
- 下一篇: iredmail邮件服务器之修改默认的w