[翻译] AGPhotoBrowser 好用的图片浏览器

简介:

AGPhotoBrowser  好用的图片浏览器

https://github.com/andreagiavatto/AGPhotoBrowser

A photo browser for iOS6 and iOS7 inspired by Facebook.

一个iOS6和iOS7的图片浏览器,灵感来自于Facebook。

Demo project included.

It currently supports:

他目前支持:

  • Any number of images through a data source
  • Optional title and description (with support for long description through a 'See more' button)
  • Full screen view
  • Pinch to zoom in/out
  • Double tap to zoom in/out
  • Orientation changes
  • "Swipe up/down" to hide the photo browser
  • "Done/Action buttons" to dismiss the browser or perform a few operations on the selected image
  • 任意数量的图片
  • 可选的标题以及描述(在“See more”按钮中还能显示更多)
  • 全屏浏览
  • 图片支持手势放大缩小
  • 双击放大与缩小
  • 可以横竖屏
  • 向上/向下滑动可以隐藏图片浏览器
  • Done/Action 按钮可以让浏览器消失或者执行少许的选择图片选择操作

Install

The suggested way to install the component is using CocoaPods, just include the following line in your Podfile to get the latest version: pod "AGPhotoBrowser"

推荐使用CocoaPods安装。

Usage

There is a demo project included that shows how to use the photo browser.

这个demo中已经像你展示如何使用这个图片浏览器了。

  • import AGPhotoBrowserView.h in your class
  • create a new instance of AGPhotoBrowserView and set the delegate and the dataSource to your class
  • implement - (NSInteger)numberOfPhotosForPhotoBrowser:(AGPhotoBrowserView *)photoBrowser and - (UIImage *)photoBrowser:(AGPhotoBrowserView *)photoBrowser imageAtIndex:(NSInteger)index methods from the datasource
  • (optional) provide a title and a description for each image implementing - (NSString *)photoBrowser:(AGPhotoBrowserView *)photoBrowser titleForImageAtIndex:(NSInteger)index and - (NSString *)photoBrowser:(AGPhotoBrowserView *)photoBrowser descriptionForImageAtIndex:(NSInteger)index
  • show the browser calling the - (void)show or - (void)showFromIndex:(NSInteger)initialIndexmethods
  • dismiss the photo browser with a completion block calling - (void)hideWithCompletion:( void (^) (BOOL finished) )completionBlock
  • 导入AGPhotoBrowserView.h引入到你的class中
  • 创建AGPhotoBrowserView的实例对象并设置delegate以及dataSource
  • 实现两个方法
  • 为每张图片提供一个标题以及描述信息
  • 显示图片浏览器
  • 退出图片浏览器

 

目录
相关文章
|
6月前
|
JavaScript 对象存储
在阿里云OpenAPI 为什么oss 图片链接, 在浏览器访问直接下载了,不是预览呢?
在阿里云OpenAPI 为什么oss 图片链接, 在浏览器访问直接下载了,不是预览呢?
425 1
|
2月前
|
域名解析 应用服务中间件 对象存储
解决阿里云oss图片浏览器访问直接下载而不是打开
解决阿里云oss图片浏览器访问直接下载而不是打开
325 0
|
8月前
Qt图片浏览器
可以显示jpg、jpeg、png、bmp。可以从电脑上拖动图到窗口并显示出来或者打开文件选择 重载实现dragEnterEvent(拖拽)、dropEvent(拖拽放下)、resizeEvent(窗口大小改变)
74 0
|
8月前
|
Swift iOS开发
iOS PhotoBrowser 横竖屏图片浏览器
iOS PhotoBrowser 横竖屏图片浏览器
103 0
|
9月前
|
Web App开发 存储 开发者
从浏览器保存的图片打不开,该咋办?
从浏览器保存的图片打不开,该咋办?
|
JavaScript 前端开发
js: color-thief在浏览器中拾取图片的主色调
js: color-thief在浏览器中拾取图片的主色调
222 0
js: color-thief在浏览器中拾取图片的主色调
|
Swift
swift之图片浏览器
swift之图片浏览器
332 0
swift之图片浏览器
|
JavaScript 前端开发
浏览器什么时候会发起网络请求,去加载一张图片?
浏览器什么时候会发起网络请求,去加载一张图片?
231 1
浏览器什么时候会发起网络请求,去加载一张图片?
案例分享:Qt九宫格图片资源浏览器(支持window、linux、兼容各国产系统,支持子文件夹,多选,全选,图片预览,行数与列数设置等)
案例分享:Qt九宫格图片资源浏览器(支持window、linux、兼容各国产系统,支持子文件夹,多选,全选,图片预览,行数与列数设置等)
案例分享:Qt九宫格图片资源浏览器(支持window、linux、兼容各国产系统,支持子文件夹,多选,全选,图片预览,行数与列数设置等)