UIViewAnimation with block
来源:互联网 发布:王克晶java年薪多少 编辑:程序博客网 时间:2024/05/07 23:13
UIViewAnimation with block
UIViewAnimationWithBlocks使用block,动画结束后不需要使用回调方法,相比UIViewAnimation 方式要简洁很多
- (void)setSelectedVeg:(id)sender
{
[selectedVegetableIcon setAlpha:0.0];
[UIView animateWithDuration:0.4
animations: ^{
float angle = [self spinnerAngleForVegetable:sender];
[vegetableSpinnersetTransform:CGAffineTransformMakeRotation(angle)];
}
completion:^(BOOL finished) {
[selectedVegetableIcon setAlpha:1.0];
}];
}
以上代码来自WWDC2010 iPlant PlantCareViem.m
UIViewAnimation style Animation
- (void)setSelectedVeg:(id)sender
{
[selectedVegetableIcon setAlpha:0.0];
[UIView beginAnimations:@"setSelectedVeg" context:nil];
float angle = [self spinnerAngleForVegetable:sender];
[vegetableSpinner setTransform:CGAffineTransformMakeRotation(angle)];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(done)];
[UIView commitAnimations];
}
-(void)done
{
[selectedVegetableIcon setAlpha:1.0];
}
No TrackBacks
TrackBack URL: http://iphone.ipsw.info/mt/mt-tb.cgi/312
- UIViewAnimation with block
- UIViewAnimation
- ASIHTTPRequest with block
- UIView动画With Block
- UIViewAnimation 详解
- UIViewAnimation 详解
- UIViewAnimation 动画
- UIViewAnimation使用简单说明
- UIView(UIViewAnimation) 的介绍
- Block的使用(Working with Blocks)
- UIViewAnimation动画与CATra…
- Get Started with the Enterprise Library Data Access Application Block
- [VB.NET]Object variable or With block variable not set
- Running MySQL on Amazon EC2 with EBS (Elastic Block
- ORA-10567: Redo is inconsistent with data block
- ERROR:NgdBuild:604 - logical block 'Inst_edksub/proc_sys_reset_0' with type 'proc
- ErrorList:Object variable or With block variable not set error
- Block mining scripts with Anti-WebMiner for Windows
- 近来学习HTML5与JQuery的一些非技术感悟
- hibernate ORM 对应关系
- SQL字符串处理函数大全
- zoj 1831 Substitution Cypher
- PHP 知识点总结
- UIViewAnimation with block
- 实体类传参
- 语句选择执行,MAP,FIELD directives
- sqlserver 日期比较
- 你在怎么折腾你的项目?
- HTTP代理服务器的原理分析与安全问答
- SVN 配置 之二 VisualSVN Server 及 Subversion
- NSOperation and KVO/KVC coding
- 用C#开发加密狗程序
Leave a comment