ios 360度旋转效果demo
来源:互联网 发布:开淘宝店卖什么最赚钱 编辑:程序博客网 时间:2024/06/03 22:41
demo功能:用UIimageView实现360度旋转效果。
demo说明:iPhone6.1 测试成功。主要代码在:FVImageSequence.m中。在touchesMoved事件中,通过替换UIimageView的image来产生旋转效果。
demo截屏:
demo主要代码:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {[super touchesMoved:touches withEvent:event]; UITouch *touch = [[event allTouches] anyObject]; CGPoint touchLocation = [touch locationInView:self];int location = touchLocation.x;//根据移动偏移量,判断旋转的方向。if(location < previous)current += increment;elsecurrent -= increment;previous = location;//图片临界点限制,在demo中的image文件夹下有所有图片,是从不同角度拍摄的,将这些图片依次显示就可以实现360的旋转效果if(current > numberOfImages)current = 0;if(current < 0)current = numberOfImages;NSString *path = [NSString stringWithFormat:@"%@%d", prefix, current];NSLog(@"%@", path);path = [[NSBundle mainBundle] pathForResource:path ofType:extension];UIImage *img = [[UIImage alloc] initWithContentsOfFile:path];//设置UIimageView的image为新的image,实现360度旋转效果[self setImage:img];[img release];}
demo下载地址:http://download.csdn.net/download/donny_zhang/5649943
- ios 360度旋转效果demo
- 360度旋转效果
- ios FlowCover效果demo
- ios 全景浏览效果demo
- ios 自制放大镜效果demo
- ios 全景浏览效果demo
- iOS侧拉栏抽屉效果Demo
- ios 动画效果实现demo
- iOS侧滑效果Demo
- jquery 点击旋转效果,点击图片旋转360度
- iOS 主菜单旋转罗盘及demo
- CSS3鼠标悬停360度旋转效果
- CSS3鼠标悬停360度旋转效果
- Android Animation 360度旋转效果。
- js---360旋转效果
- HTML5+原生javascript 卡片扑克旋转展开效果demo
- css效果实现一个物体的旋转小demo
- IOS-试图旋转效果的实现
- 编程挑战(1)
- Execl 操作
- 浅谈长尾理论--《Makers》读后感
- Http 416错误解决方案 HTTP response code: 416
- ViewStub(惰性控件/延时加载)
- ios 360度旋转效果demo
- Windows异常处理
- [数据存储]属性列表plist
- js去除数组重复
- io strong,weak ,__unsafe_unretained, __autoreleasing
- 使用ssh登录freebsd
- [数据存储]CoreData
- [jtable]JDK SwingSet3 jtable源码
- USB介绍