是否有机会访问图库,获取照片列表并在应用程序中使用它们?当然,如果可以按标准过滤它们(按日期范围拍照)?
答案 0 :(得分:0)
GingerComa,我想你想用户从画廊中选择图片吧?我用这个nativescript插件完成了这个:
https://www.npmjs.com/package/nativescript-imagepicker
import * as imagepicker from "nativescript-imagepicker";
let context = imagepicker.create({
mode: "single" // use "multiple" for multiple selection
});
context
.authorize()
.then(function() {
return context.present();
})
.then(function(selection) {
selection.forEach(function(selected) {
// process the selected image
});
list.items = selection;
}).catch(function (e) {
// process error
});