react-native-image-cropper-thanhtq
Result
iOS Installation
do it manually as described below:
- Run
npm install react-native-image-cropper-thanhtq --save
- Open your project in XCode, right click on
Libraries
and clickAdd Files to "Your Project Name"
Look undernode_modules/react-native-image-cropper-thanhtq
and addTOCropViewController.xcodeproj
. - Add
libImageCropperManager.a
toBuild Phases -> Link Binary With Libraries
- Done!
Android Installation
Run npm install react-native-image-cropper-thanhtq --save
You can use the React Native CLI to add native dependencies automatically:
$ react-native link react-native-image-cropper-thanhtq
Manual setup
In android/settings.gradle
... include ':react-native-image-cropper-thanhtq'project(':react-native-image-cropper-thanhtq').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-cropper-thanhtq/android')
In android/app/build.gradle
... dependencies { ... compile project(':react-native-image-cropper-thanhtq')}
Register module (in MainApplication.java
)
// <--- Import Package
Usage
- For Android:
let options = guideLines: 'on-touch' cropShape: 'rectangle' title: 'CROP AVATAR' cropMenuCropButtonTitle: 'Done' uri_image: responsepath fixAspectRatio: true ImageCropper;
- For iOS:
;let options = urlBase64Image: 'data:image/jpg;base64,' + responsedata path: responseuri ImageCropper
----------------------END------------------------