LPPhotoViewer
是一个简单的图片浏览器(支持 gif 图片)
附加信息
Swift 版本在此处 GitHub
安装
- 使用 Cocoapods
pod 'LPPhotoViewer', '~> 0.1.1'
- 手动导入
just download lib folder and add into your project
使用方法
- 初始化图片 URL 数组或 UIImage 对象
self.urlArrays = [[NSMutableArray alloc] init];
self.imgArrays = [[NSMutableArray alloc] init];
[self.urlArrays addObject:@"https://drscdn.500px.org/photo/42393810/q=80_m=2000/fed5ccbf106c289f62e5762df92f1438"];
[self.urlArrays addObject:@"https://drscdn.500px.org/photo/146441995/q=80_m=2000/0a6e687c0750ea05abf709bbd8c3d7f8"];
[self.urlArrays addObject:@"https://drscdn.500px.org/photo/146512755/q=80_m=2000_k=1/62c584ed280fb11bbdb7d1c5451b6676"];
[self.urlArrays addObject:@"https://drscdn.500px.org/photo/146409463/q=80_m=2000/9658bd373b7f84799dda05253d404a5d"];
[self.imgArrays addObject:[UIImage imageNamed:@"carousel01"]];
[self.imgArrays addObject:[UIImage imageNamed:@"carousel02"]];
[self.imgArrays addObject:[UIImage imageNamed:@"carousel03"]];
- 为 LPPhotoViewer 设置属性
LPPhotoViewer *pvc = [[LPPhotoViewer alloc] init];
// 1. for image urls
pvc.imgArr = self.urlArrays;
// 2. for UIImage objs
pvc.imgArr = self.imgArrays;
/** for custom properties */
// 1. show from specify index
pvc.currentIndex = 2;
// 2. indicatorType: IndicatorTypeNumLabel or IndicatorTypePageControl or none
pvc.indicatorType = IndicatorTypeNumLabel;
- 显示 LPPhotoViewer
[self presentViewController:pvc animated:YES completion:nil];
截图
注意事项
LPPhotoViewer 将升级到 1.x & Swift3,性能将更优
发布说明
版本 0.1.1
支持 gif 图像
版本 0.1.0
更新 SDWebImage 依赖
版本 0.0.7
更新库依赖关系
版本 0.0.6
添加淡入过渡效果 & 淡出拖拽效果
版本 0.0.5
新增进度查看器 & 拖拽修复错误
版本 0.0.4
添加垂直拖拽手势以实现关闭
版本 0.0.3
添加缩放重置修复
版本 0.0.2
添加页面控制指示类型
版本 0.0.1
第一次提交