我正在使用the following example from the offical website - 因此设置sourceType为CAMERA而不是PHOTOLIBRARY。ngCordova相机不打开相机,但相册
var options = {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 100,
targetHeight: 100,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}, function(err) {
// error
});
,并使用PhoneGap的构建正在测试我的应用程序,从而结合以下插件在我的config.xml:
然而,当我发起上面的代码,然后在我的应用它打开我的电话相册 - 因此迫使我选择图像而不是拍摄照片。到底是怎么回事?
你使用这些选项后建立自己的代码?可能你需要的东西像phonegap构建ios或phonegap构建android – 2015-08-17 16:35:32