LPThumbnailView
适用于iOS的上下文图像缩略视图。
特性
- 易于使用
- 流畅的动画
- 可自定义
- 使用最新Swift编写
需求
- iOS 10.0+
安装
CocoaPods
-
将此仓库添加到您的
Podfile
target 'Example' do # IMPORTANT: Make sure use_frameworks! is included at the top of the file use_frameworks! pod 'LPThumbnailView' end
-
运行
pod install
-
打开CocoaPods创建的
.xcworkspace
-
完成!
Carthage
配合Carthage使用
-
确保已安装Carthage
brew install carthage
-
将此仓库添加到您的Cartfile
github "luispadron/LPThumbnailView"
-
从
MyProjDir/Carthage/Builds/iOS/LPThumbnailView
中将LPThumbnailView.framework
拖到您的Xcode项目“General -> Embedded Binaries”部分。
手动
- 简单下载此处的源文件并将它们拖到项目中。
用法
简单动画
// Pick your animation style
thumbnailView.animationStyle = .enterFromRight
// Simply add an image to the thumbnail view, animation is handled for you!
thumbnailView.addImage(image)
上下文动画
// Create/use an existing image view you would like to be animated to the position of the thumbnail.
let imgView = UIImageView(image: someImage)
// Animation from imgView to thumbnail is handled for you!
// imgView will animate to the correct frame and will be removed from the super view on completion of animation.
thumbnailView.addImageWithContext(imgView)
文档
请在此处阅读文档以获取更多信息,并在发布问题之前先阅读。
示例项目
请查看示例项目这里