使图片自动移动的方法
来源:互联网 发布:帝国cms 整站迁移 编辑:程序博客网 时间:2024/06/05 06:43
使图片自动移动的方法
by lesvio
- (void)setOffSetAnimation:(UIImageView *)imageView Duration:(NSInteger)duration{ NSInteger imageHeight = imageView.image.size.height; NSInteger imageWidth = imageView.image.size.width; NSInteger frameWidth = imageView.frame.size.width; NSInteger frameHeight = imageView.frame.size.height; NSInteger xOffSet = (frameHeight*imageWidth/imageHeight-frameWidth)/2; CAKeyframeAnimation *animation; animation = [CAKeyframeAnimation animationWithKeyPath:@"position.x"]; animation.duration = duration; animation.repeatCount = HUGE_VALF; animation.values = [NSArray arrayWithObjects: [NSNumber numberWithFloat:160.0f], [NSNumber numberWithFloat:160 + xOffSet], [NSNumber numberWithFloat:160.0f], [NSNumber numberWithFloat:160 - xOffSet], [NSNumber numberWithFloat:160.0f], nil]; animation.removedOnCompletion = NO; [imageView.layer addAnimation:animation forKey:nil];}
gif不会动!!!!唉!!!!!!!!
0 0
- 使图片自动移动的方法
- 使图片自动移动的方法
- 图片在边框内的自动移动
- WPF图片自动移动
- jQuery中的animate的应用(图片的自动移动)
- js 实现图片自动移动
- js 实现图片自动移动
- 1:图片实现从下到上的自动移动(JS实现)
- 简单的鼠标移动到图片自动放大及缩小
- 简单方法的让图片自动切换
- 自动选择图片路径的方法
- 移动端音频自动播放的方法(js)
- 图片随着鼠标移动而拉伸,超过固定div宽度,图片自动隐藏超过的部分
- 移动端图片上传方法
- 移动端图片上传方法
- 使背景图片移动的方法
- 循环移动的图片
- 循环移动的图片
- 引用
- CXF的WebService客户端超时了解
- ACM-计算几何之Surround the Trees——hdu1392
- VMware Player vs. VirtualBox: feature comparison
- YUV格式详解
- 使图片自动移动的方法
- 未能从程序集中加载类型
- WMI and ACPI 问题
- 环太平洋不看IMAX3D就等于没看过
- DB2备份及恢复db2backup专题(基础)
- 《线性表的类表示——数据结构JAVA》
- Oracle基础及基本命令
- 观察者模式——委托的使用
- 注释过滤