Here is a browser page for multiple local or remote photos.
It supports:
- Multiple photos.
- Local image or remote url.
- Delete item.
- Save item to local.
- Image for placeholder or fail load.
- Orientation supported.
Install by Yarn:
yarn add react-native-photo-browse
Install by NPM:
npm install --save react-native-photo-browse
First import in the file:
import * as PhotoBrowser from 'react-native-photo-browse';
Then call method in function:
func = () => {
const options = {
// ...options
};
PhotoBrowser.showPhotoBrowserPage(options);
}
Name | Description |
---|---|
images | Image urls array to show |
failImage | A placeholder image when image is invalid |
currentIndex | Initial index of image to show. Default is 0 |
canDelete | Enable or disable delete button. Default is false |
canSave | Enable or disable save button. Default is false |
okLabel | Label of OK button |
deleteLabel | Label of Delete button |
saveLabel | Label of Save button |
saveSuccessText | Save success tips |
saveFailureText | Save failure tips |
loadingText | Loading tips |
onClose | Callback method when close |
supportedOrientations | Orientations supported for Modal |
You can change settings globally.
import {PhotoBrowserPage} from 'react-native-photo-browse';
PhotoBrowserPage.defaultProps.xxx = yyy;
xxx
is a key of options