我希望能获取移动设备的完整图库,并将它们显示在自定义网格中,这是可能的吗?目前我正在使用“$cordovaImagePicker”,它会将我重定向到图库,然后在选择图像后我会得到该图像的Uri。相比较而言,我希望自动选择完整的图库图像Uri。
控制器
$scope.getImageFromGallery = function() {
// Image picker will load images according to these settings
var options = {
maximumImagesCount: 1, // Max number of selected images, I'm using only one for this example
width: 800,
height: 800,
quality: 80 // Higher is better
};
$cordovaImagePicker.getPictures(options).then(function(results) {
// Loop through acquired images
for (var i = 0; i < results.length; i++) {
alert(results);
$scope.image = results[i];
// Print image URI
}
}, function(error) {
console.log('Error: ' + JSON.stringify(error)); // In case of error
});
}