我在 Ionic 应用程序中使用图像选择器插件。我希望能够从 android 设备中的图库中的其他文件夹中选择图像。对于 Ios 是可能的,但对于 android 我得到了这个视图。
但我希望用户能够转到其他文件夹并从中选择图像。任何帮助都会很棒。
我假设您正在使用 cordova plugin File
。如果你想选择其他路线,你可以使用提供的不同目录File
。埃杰:
this.file.applicationStorageDirectory
this.file.applicationDirectory
this.file.documentsDirectory
您在这里有完整的列表https://github.com/apache/cordova-plugin-file
如果您需要更多帮助,请告诉我。
使用如果使用 Filepicker 使用常量来设置选项:
const options = {
title: 'Select Avatar',
customButtons: [{ name: 'fb', title: 'Choose Photo from Facebook' }],
storageOptions: {
skipBackup: true,
path: 'images',
},
};
并将其发送给选择器:
ImagePicker.showImagePicker(options, (response) => {