我有一个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() });
`
发布于 2021-04-20 15:57:50
“"org.openxmlformats.wordprocessingml.document”“,分别表示com.microsoft.word.doc和Docx。
https://stackoverflow.com/questions/67097556
复制相似问题