Camera 最新版本android或更高版本8的nativescript中的摄像头正在崩溃。有什么解决办法吗
我在用本机脚本使用相机时遇到了一个问题。当我拍照时,它被撞坏了。 下面是我尝试过的代码 函数onTap(){Camera 最新版本android或更高版本8的nativescript中的摄像头正在崩溃。有什么解决办法吗,camera,nativescript,Camera,Nativescript,我在用本机脚本使用相机时遇到了一个问题。当我拍照时,它被撞坏了。 下面是我尝试过的代码 函数onTap(){ }发布崩溃的错误日志…如果仍然存在问题,请更新错误日志。 const options = { width: 300, height: 300, keepAspectRatio: false, saveToGallery: true }; camera.requestPermissions().then( function success() {
}发布崩溃的错误日志…如果仍然存在问题,请更新错误日志。
const options = {
width: 300,
height: 300,
keepAspectRatio: false,
saveToGallery: true
};
camera.requestPermissions().then(
function success() {
camera.takePicture(options)
.then(function (imageAsset) {
console.log("Size: " + imageAsset.options.width + "x" + imageAsset.options.height);
console.log("keepAspectRatio: " + imageAsset.options.keepAspectRatio);
console.log("Photo saved in Photos/Gallery for Android or in Camera Roll for iOS");
}).catch(function (err) {
console.log("Error -> " + err.message);
});
});