连续动画
来源:互联网 发布:jquery.qrcode.js 编辑:程序博客网 时间:2024/04/30 08:27
但是表现出来的效果是,button直接移动到第一个位置,然后用了3秒的时间,移动到了第二个位置
- (id)init{
self = [super init];
if (self != nil) {
[self.view setBackgroundColor:[UIColor greenColor]];
button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 100, 20, 50)];
[self.view addSubview:button1];
button1.backgroundColor = [UIColor redColor];
button1.hidden = NO;
[UIView beginAnimations:@"move button" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animation2:)];
[UIView setAnimationDuration:2];
button1.frame = CGRectMake(100, 0, 100, 100);
// button1.frame = CGRectMake(100, 100, 100, 100);
//button1.frame = CGRectMake(200, 100, 100, 100);
[UIView commitAnimations];
}
return self;
}
-(void)animation2:(id)sender{
[UIView beginAnimations:@"move button" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animation3:)];
[UIView setAnimationDuration:2];
button1.frame = CGRectMake(100, 100, 100, 100);
//button1.frame = CGRectMake(200, 100, 100, 100);
[UIView commitAnimations];
}
-(void)animation3:(id)sender{
[UIView beginAnimations:@"move button" context:nil];
[UIView setAnimationDuration:2];
button1.frame = CGRectMake(200, 100, 100, 100);
[UIView commitAnimations];
}
- 连续动画
- 动画连续播放
- iOS 之连续动画
- 连续平移动画
- 图片连续切换动画Demo
- cocos2dx coscostudio 动画连续播放
- android的XML连续动画
- j2me drawImage方法实现的连续动画
- iPhone开发创建连续动画案例
- 多张图片整合成连续动画
- 多张图片合成连续动画
- 多张图片连续动画实现
- 利用UIImageView连续播放图片动画效果
- IOS 连续图片组成的动画
- NSTimer实现连续帧动画播放
- 视图连续弹出动画 的效果
- Animation中多段动画的连续播放
- AnimationDrawable连续new,star动画效果没有?
- v4l2文档第五A--颜色与格式
- How to Buy a Wireless Router
- v4l2驱动编写篇第五B--格式的协定
- 留个脚印
- v4l2驱动编写篇第六A--基本的帧输入输出
- 连续动画
- linux下rvm,ruby,rails安装
- mysql 远程连接授权命令
- 复制表结构和数据SQL语句
- 判断单链表是否存在环,判断两个链表是否相交问题详解
- v4l2驱动编写篇第六B--流输入输出
- JqueryEasyUI修改DataGrid使其支持多选框
- v4l2驱动编写篇第七--控制方法
- UML--时序图例子