我需要使用react-native-image picker启动裁剪窗口。但是下面提到的代码片段对我不起作用。有什么建议
ImagePicker.launchImageLibrary(options, (response) => {
if (response.didCancel) {
console.warn('Cancel photo picker');
}
else if (response.error) {
console.warn('ImagePicker Error: ', response.error);
}
else {
console.warn('ImagePicker no Error: ', response.error);
ImagePicker.openCropper({
path: response,
width: deviceWidth,
height: deviceWidth*5/4,
cropperToolbarTitle: '',
hideBottomControls: true,
enableRotationGesture: true,
avoidEmptySpaceAroundImage:true
}).then(image => {
this.props.navigation.navigate('ShowAllCroppedImage', {uri: response.uri, croppedImage: this.croppedImage.bind(this)});
})
.catch((err) => {
console.log("openCropper error = " + err)
});
}
});
}