Xamarin iOS:过滤掉文档选择器上的 FileType 显示

Lit*_*nny 2 file-type contenttype ios xamarin

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

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

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"
        };
Run Code Online (Sandbox Code Playgroud)

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

有没有我没有涵盖的其他文档类型,例如苹果的特定文档文件。

Pra*_*nth 5

        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"
        };
Run Code Online (Sandbox Code Playgroud)

这些是我的 UTType,

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