[翻譯] AGPhotoBrowser 好用的圖片瀏覽器

AGPhotoBrowser  好用的圖片瀏覽器git

https://github.com/andreagiavatto/AGPhotoBrowsergithub

A photo browser for iOS6 and iOS7 inspired by Facebook.瀏覽器

一個iOS6和iOS7的圖片瀏覽器,靈感來自於Facebook。ide

Demo project included.spa

It currently supports:code

他目前支持:component

  • 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"orm

推薦使用CocoaPods安裝。對象

Usage

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

這個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
  • 實現兩個方法
  • 爲每張圖片提供一個標題以及描述信息
  • 顯示圖片瀏覽器
  • 退出圖片瀏覽器
相關文章
相關標籤/搜索