【发布时间】:2021-07-09 20:19:03
【问题描述】:
我有一个 xamarin 应用程序,我正在使用 Essential File Picker 从库中选择文件。我正在尝试找到一种方法来为 IOS 定义 doc 和 docx 文件,但我做得不对。 对于Android,我开始了。 下面是我用过的代码。
`
private List<string> androidAcceptableList = new List<string> { "application/pdf", "image/*" }; //TODO:Read from configuration
private List<string> iOsAcceptableList = new List<string> { "application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"image/*"}; //TODO:Read from configuration
var customFileTypes = new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>> {
{ DevicePlatform.iOS,iOsAcceptableList },
{ DevicePlatform.Android, androidAcceptableList}
});
var resp = FilePicker.PickAsync(new PickOptions { FileTypes = FileTypesList() });
`
【问题讨论】:
-
"com.microsoft.word.doc","org.openxmlformats.wordprocessingml.document".