几种常见的动画
来源:互联网 发布:淘宝摄影需要什么器材 编辑:程序博客网 时间:2024/06/05 04:08
一、图片的旋转
- (void)rotateImageView:(UIImageView *)iv
{
[UIViewanimateWithDuration:.5delay:0options:UIViewAnimationOptionCurveLinear
animations:^{
iv.transform =CGAffineTransformRotate(iv.transform,M_PI / 2);
}
completion:^(BOOL finished) {
if(finished)
[selfrotateImageView:iv];
}];
}
二、图片的动态放大和缩小
- (void)pulseImageView:(UIImageView *)iv
{
[UIViewanimateWithDuration:1delay:0options:UIViewAnimationCurveEaseOut
animations:^{
iv.transform =CGAffineTransformScale(iv.transform,2, 2);
}
completion:^(BOOL finished) {
[UIViewanimateWithDuration:1delay:0options:UIViewAnimationCurveEaseIn
animations:^{
iv.transform =CGAffineTransformScale(iv.transform,.5, .5);
}
completion:^(BOOL finished) {
if(finished)
[selfpulseImageView:iv];
}];
}];
}
- (void)raining
{
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"angrycloud"]];
imageView.center = CGPointMake(160,125);
[self.backgroundImageView addSubview:imageView];
[self.backgroundImageView bringSubviewToFront:imageView];
}
- (void)weatherItem:(NSString *)name andLevel:(CGFloat)level
{
if(self.generator){
[self.generatorinvalidate];
self.generator =nil;
}
self.generator = [NSTimerscheduledTimerWithTimeInterval:(.1*(1/level))target:selfselector:@selector(addItem:)userInfo:name repeats:YES];
}
//云朵下动态的雨滴
- (void)addItem:(NSTimer *)timer
{
NSString *image = timer.userInfo;
int x = arc4random()%80;
int y = arc4random()%100;
UIImageView *imageView = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:image]];
imageView.center =CGPointMake(x+120,y+120);
[self.backgroundImageViewaddSubview:imageView];
[self.backgroundImageViewsendSubviewToBack:imageView];
[selftweenLeftImageView:imageView];
}
- (void)tweenLeftImageView:(UIImageView *)iv
{
CGPoint point = iv.center;
[UIViewanimateWithDuration:1delay:0options:UIViewAnimationOptionCurveLinear
animations:^{
iv.center =CGPointMake(point.x-50,point.y+200);
iv.alpha =0;
}
completion:^(BOOL finished) {
[ivremoveFromSuperview];
}];
}
- 几种常见的动画
- Android:关于Animation的几种常见的动画
- android开发中常见的几种动画
- activity 几种常见切换动画
- android的几种动画
- 常见的几种RuntimeException-
- 几种常见的排序
- 常见的几种RuntimeException
- 常见的几种排序
- 常见的几种RuntimeException-
- 常见的几种RuntimeException
- 几种常见的排序
- 常见的几种字符集
- 常见的几种RunTimeExecption
- 常见的几种排序
- 常见的几种RuntimeException
- 常见的几种RuntimeException
- 几种常见的查找
- MapReduce编程
- Spark调研笔记第7篇 - 应用实战: 如何利用Spark集群计算物品相似度
- _itoa atoi、atof、itoa、itow _itoa_s 类型转换使用说明
- ZWK so lazy
- HTML特殊字符过滤器
- 几种常见的动画
- 一行代码搞定所有屏幕适配
- Java引用传递和值传递
- postgres 引起oom问题的 explain 分析。
- base64
- Spring+Mybatis 多数据源配置
- SolrCloud Wiki翻译(1) Getting Started with SolrCloud
- TortoiseSVN客户端重新设置用户名和密码
- qt中的undo和redo机制。