react-native-full-image-picker It is a react native UI component including a camera view and an album selection view. You can take photos, take video recording or select photo from photo library.
It supports:
Same UI on Android.
Install by Yarn:
yarn add react-native-full-image-picker
Install by NPM:
npm install --save react-native-full-image-picker
You should also install native code of these libraries:
First import in the file:
import * as ImagePicker from 'react-native-full-image-picker';
It has three method:
ImagePicker.getCamera(options)
: Take photo.ImagePicker.getVideo(options)
: Video recording.ImagePicker.getAlbum(options)
: Select from photo library.options
is a object with these settings:
callback: (data: any[]) => void
: Callback method with photo or video array. Do not use Alert
in it.maxSize?: number
: The maximum number of photo count. Valid in camera or video.sideType?: RNCamera.Constants.Type
: Side of camera, back or front. Valid in camera or video.flashMode?: RNCamera.Constants.FlashMode
: Flash mode. Valid in camera or video.You can use react-native-general-actionsheet to show ActionSheet
by same API and UI with ActionSheetIOS
.
You can import page and change defaultProps
to modify labels globally:
import * as ImagePicker from 'react-native-full-image-picker';
ImagePicker.XXXPage.defaultProps.xxx = yyy;
ImagePicker.XXXView.defaultProps.xxx = yyy;
The XXXPage
or XXXView
is the export items of library. And you can see source code to modify its defaultProps
value.
Author: gaoxiaosong
GitHub: https://github.com/gaoxiaosong/react-native-full-image-picker
#react-native #programming #reactjs