微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

IOS 的 Xamarin 文件选择器文件类型

如何解决IOS 的 Xamarin 文件选择器文件类型

我有一个 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() });

`

解决方法

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,

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。