我正在将电容器与Ionic 4配合使用,当用户在相机上点击“取消”时,我想抓住它。
public async takePicture(): Promise<string> {
const image: CameraPhoto = await Camera.getPhoto({
quality: 90,
allowEditing: true,
correctOrientation: true,
resultType: CameraResultType.Uri,
source: CameraSource.Camera
}).catch((e) => {
throw new Error(e);
});
return this._IMAGE = image.webPath;
}
我只是试图抓住并出错,但是与cordova相比,单击Cancel不再抛出错误。如何在相机上捕捉cancel