iOS图片选择器:JSImagePickerController
y37f
10年前
JSImagePickerController是一款使用的图片选择器。比起其他选择器多了滚动视图,能够快速选择图片库中的图像。
安装
Just drop the two files for the JSImagePickerViewController class into your project and import them into whichever view controllers you want:
#import "JSImagePickerViewController.h"
Next, put this code in your project to create and show the image picker:
JSImagePickerViewController *imagePicker = [[JSImagePickerViewController alloc] init]; imagePicker.delegate = self; [imagePicker showImagePickerInController:self animated:YES];
and add this delegate method to your code:
- (void)imagePickerDidSelectImage:(UIImage *)image;
and if you want there are a choice of different delegate methods to choose from:
- (void)imagePickerDidOpen; - (void)imagePickerWillOpen; - (void)imagePickerWillClose; - (void)imagePickerDidClose; - (void)imagePickerDidCancel;
and for personalization you can edit the public property's of the image picker:
@property (nonatomic) NSTimeInterval animationTime; @property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UIButton *photoLibraryBtn; @property (nonatomic, strong) UIButton *cameraBtn; @property (nonatomic, strong) UIButton *cancelBtn;
项目主页:http://www.open-open.com/lib/view/home/1426423933672