gpt4 book ai didi

ios - navigator.camera.getPicture 没有调用成功调用?

转载 作者:行者123 更新时间:2023-11-28 21:48:18 25 4
gpt4 key购买 nike

camera.getPicture 用于在 cordova 中捕获图像。该项目是使用 cordova 3.2.0 开发的。现在我已经将 Cordova 更新到 3.8.0。现在 navigator.camera.getPicture 不会同时调用成功调用和失败调用。在做了一些试验后,我发现它的发生是由于在选项中添加了这 3 个参数

allowEdit : true,
targetWidth: 250,
targetHeight: 250,

var options = {
quality : 100,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
encodingType : Camera.EncodingType.JPEG,
allowEdit : true,
targetWidth: 250,
targetHeight: 250,
correctOrientation: 0,
//popoverOptions : popover
};

当我删除这些参数时,它工作正常。谁能指导我这里发生了什么?感谢您的帮助。

最佳答案

成功了。问题是我已经更新了 Cordova 。但是相机插件还是旧的。所以我需要卸载旧的相机插件并重新安装。

关于ios - navigator.camera.getPicture 没有调用成功调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29247470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com