【问题标题】:Xamarin file picker file types for IOSIOS 的 Xamarin 文件选择器文件类型
【发布时间】: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() });

`

【问题讨论】:

标签: xamarin.essentials


【解决方案1】:

How to open the Document files e.g(.pdf,.doc,.docx) in ios mobile when a button action using swift3.0?

"com.microsoft.word.doc","org.openxmlformats.wordprocessingml.document" 分别用于 Doc 和 Docx,

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-13
    • 2014-03-11
    相关资源
    最近更新 更多