ios - Xamarin iOS : Filtering out the FileType show on Document Picker

标签 ios xamarin file-type contenttype

我正在尝试过滤掉所有不是图像、视频、音频、pdf 和其他文档文件的文件,例如微软。

目前,我的代码中有这个:

var allowedUTIs = new string[] {
            UTType.Image,
            UTType.PDF,
            UTType.Video,
            UTType.Audio,
            UTType.Movie,
            UTTYPE.Text,
            "com.microsoft.word.doc",
            "com.microsoft.excel.xls",
            "com.microsoft.powerpoint.ppt",
            "org.openxmlformats.wordprocessingml.document"
        };

主要关注的是自定义类型。它是否涵盖所有 Microsoft Office 文件类型:doc、xls、ppt、docx 等...

是否还有其他我没有涉及的文档类型,例如苹果的特定文档文件。

最佳答案

        var allowedUtis = new string[] {
            UTType.UTF8PlainText,
            UTType.PlainText,
            UTType.RTF,
            UTType.PNG,
            UTType.Text,
            UTType.PDF,
            UTType.Image,
            UTType.UTF16PlainText,
            UTType.FileURL,
            "com.microsoft.word.doc",
            "org.openxmlformats.wordprocessingml.document",
            "com.microsoft.powerpoint.​ppt"
            "org.openxmlformats.spreadsheetml.sheet",
            "org.openxmlformats.presentationml.presentation",
            "com.microsoft.excel.xls"
        };

这些是我的 UTType,

在此,对于 doc“com.microsoft.word.doc”,对于 docx“org.openxmlformats.wordprocessingml.document”等。我已经针对所有文档进行了测试。

关于ios - Xamarin iOS : Filtering out the FileType show on Document Picker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41797644/

相关文章:

javascript - react : onClick on Mobile (iPhone) requires 2 taps?

c# - Parcelable List<string>, List<int>

emacs - 如何让 emacs 正确处理扩展名错误的文件?

visual-studio - silverlight 中 CodeFile.cs 和 Class.cs 的区别

vim:如何在插件脚本中获取文件类型

objective-c - iOS:在运行时以编程方式添加多个 UIImageView

ios - 如何在加载响应后加载 View Controller (或调用 segue)(使用 Alamofire)?

ios - 为什么平均颜色不会产生黑色以外的结果?

xamarin - Apple 开发者帐户团队未出现在 VS Mac 上

android - 您必须提供 layout_height 属性