无法在IOS中拍照或从图库中选择图像

时间:2019-04-11 13:14:20

标签: ionic3

当我从图库中获取图像时,出现SELECT_PICTURE错误或从相机拍摄照片。

我的代码是:

-对于照相馆

const Liboptions: CameraOptions = {
  quality: 100,
  destinationType: this.camera.DestinationType.DATA_URL, 
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  sourceType:this.camera.PictureSourceType.SAVEDPHOTOALBUM       
}

this.camera.getPicture(Liboptions).then((imagePath) => {});

-对于相机

const CamOptions: CameraOptions = {
  quality: 100,
  destinationType: this.camera.DestinationType.FILE_URI,
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  sourceType: this.camera.PictureSourceType.CAMERA  
}

this.camera.getPicture(CamOptions).then((imagePath)=>{})

显示错误是:

TypeError: Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"]) is not a function. (In 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])(this, "getPicture", { "callbackOrder": "reverse" }, arguments)', 'Object(__WEBPACK_IMPORTED_MODULE_1__ionic_native_core__["cordova"])' is an instance of Object)

0 个答案:

没有答案