我想獲取一個移動設備的完整畫廊,以在自定義網格中顯示它們,這有可能嗎?現在我正在使用$cordovaImagePicker
,它將我重定向到圖庫,然後在選擇圖像後獲取圖像的Uri。而不是我想要完整的畫廊圖像uri自動選擇。如何使用cordova獲取手機的所有圖庫圖像?
Controller
$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
});
}
IOS?的android?都? – jcesarmobile
是的,對於IOS和Android和Windows也是如此:) – mayank
類似的未回答的問題:http://stackoverflow.com/questions/28997384/cordova-phonegap-photo-browser – daserge