仿照今日头条的图片浏览功能,实现的轻量级图片浏览工具。
左右切换 | 加载网络图片 | 捏合、双击 | 下滑隐藏 | 保存到相册 |
---|---|---|---|---|
- 加载网络图片的功能时利用SDWebImage实现的,所以在使用XLImageViewer时需要在项目里添加SDWebImage。
- 图片切换时利用UICollectionView实现的;图片的缩放是利用ScrollView的缩放原理实现的。
查看网络图片:
[[XLImageViewer shareInstanse] showNetImages:[self imageUrls] index:indexPath.row fromImageContainer:[collectionView cellForItemAtIndexPath:indexPath]];
查看本地图片:
[[XLImageViewer shareInstanse] showLocalImages:[self imagePathes] index:indexPath.row fromImageContainer:[collectionView cellForItemAtIndexPath:indexPath]];
之前利用ScrollView实现切换的版本:戳这里