UIView的简单动画
来源:互联网 发布:js变量为空 编辑:程序博客网 时间:2024/04/29 03:19
UIView的简单动画
//方法1
//设置简单动画//1.开始动画[UIView beginAnimations:nil context:nil];//2.持续时间[UIView setAnimationDuration:2.0];//3.动画效果fatherView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);//4.提交动画[UIView commitAnimations];
//方法2
[UIView animateWithDuration:1.0 animations:^{ //动画效果 fatherView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);} completion:^(BOOL finished) { //动画结束时调用 fatherView.frame = CGRectMake(0, 0, 200, 200);}];
UIView简单动画test
- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib._view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];_view.backgroundColor = [UIColor redColor];[self.view addSubview:_view];[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(timeGo) userInfo:nil repeats:YES];}- (void)timeGo{[UIView animateWithDuration:2.0 animations:^{ _view.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);} completion:^(BOOL finished) { _view.frame = CGRectMake(0, 0, 100, 100);}];}
1 0
- UIView的简单动画
- UIView的简单动画
- ios 交换两个uiview的简单动画
- 关于UIView的简单动画效果
- IOS中UIView动画的简单实现
- ios 交换两个uiview的简单动画
- iOS UIView简单的缩放动画效果
- UIview简单动画
- UIView简单动画
- UIview 简单动画
- ios--UIView简单动画
- Swift UIview简单动画
- CYC- 简单UIView动画
- swift UIView简单动画
- ios--UIView动画简单示例
- 2.7 UIView动画简单示例
- iOS之UIView简单动画
- ios菜鸟之路:UIView简单的动画
- React组件
- 4、spring入门—Spring Bean的装配(下)
- 常用MySQL语句(1)
- eclipse安装JAVA反编译插件
- torch入门笔记20:torch实现freeze layer的操作
- UIView的简单动画
- Codeforces 516B Drazil and Tiles【类拓扑排序】好题!
- Linux下oracle数据库启动和关闭操作
- Idea利用Git提交代码到github步骤
- 二叉树遍历94. Binary Tree Inorder Traversal
- JAVA多线程和并发基础面试问答(转载)
- 136. Single Number
- 二叉树遍历144. Binary Tree Preorder Traversal
- myisam和innodb的区别