从图库中获取图像时显示加载程序

时间:2018-12-18 05:39:51

标签: ionic-framework angular6 ionic-native ionic4

我正在开发ionic v4中的应用程序,需要从图库中上传个人资料图片。因此,我正在使用@ionic-native/camera插件,下面是我的代码:

const options: CameraOptions = {      
      targetWidth: 800,
      targetHeight: 600,
      destinationType: this.camera.DestinationType.DATA_URL,
      encodingType: this.camera.EncodingType.PNG,
      mediaType: this.camera.MediaType.PICTURE,
      correctOrientation: true,
      sourceType: sourceType,
}
this.camera.getPicture(options).then((imageData) => {
    console.log(imageData);
})

问题陈述是,即使我选择1mb大小的图像,屏幕也会花费时间来渲染图像,因此时间屏幕是空白的,甚至旋转器/加载器也不可见。

在处理图像时,我需要放置一个加载器。

0 个答案:

没有答案
相关问题