首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS MusicXML文件在UIDocumentPickerViewController中是灰色的

iOS MusicXML文件在UIDocumentPickerViewController中是灰色的
EN

Stack Overflow用户
提问于 2018-05-30 09:57:55
回答 2查看 262关注 0票数 0

我有一个iOS项目C#。我实现了一个UIDocumentPickerViewController,它可以将外部文件导入到我的应用程序中。PDF和XML在iOS 11上的工作方式类似于以下代码:

代码语言:javascript
复制
// Allow the Document picker to select a range of document types
var allowedUTIs = new string[] {
                                    UTType.PDF,
                                    UTType.XML,
                                    "com.recordare.musicxml",
                                    "com.recordare.musicxml.uncompressed",
                                    "public.data",
                                    "public.mxl",
                                    "public.content"
};

 UIDocumentPickerViewController picker = new UIDocumentPickerViewController(allowedUTIs, UIDocumentPickerMode.Import);

但是,.mxl文件,即MusicXML文件在文件应用程序(DocumentPicker视图)中显示为灰色。

在我的Info.plist文件中,我有以下文档类型:

以及导入的UTIs

我在谷歌上搜索MusicXML社区声明的官方UTI。在他们的网站上,我只看到了关于提议的UTI的讨论,说明如下:https://forums.makemusic.com/viewtopic.php?f=12&t=2510

附件是一个XML文件(也在这封电子邮件的底部),其中包含基于苹果文档中提供的信息为MusicXML发布的UTI声明提案。我们使用了以下类型标识符:未压缩MusicXML: com.musicxml.musicxml压缩MusicXML: com.musicxml.musicxml-压缩

我还在我的Info.plist中尝试过这两个UTIs (com.musicxml.musicxmlcom.musicxml.musicxml-compressed)。但还是没成功。

有人能帮我一下吗?

编辑1:在这里您可以看到整个Info.plist文件:

代码语言:javascript
复制
    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIdentifier</key>
            <string>com.recordare.musicxml.uncompressed</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.musicxml.org/</string>
            <key>UTTypeDescription</key>
            <string>MusicXML</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>xml</string>
                </array>
                <key>public.mime-type</key>
                <array>
                    <string>application/vnd.recordare.musicxml+xml</string>
                </array>
            </dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>
        </dict>
        <dict>
            <key>UTTypeIdentifier</key>
            <string>com.recordare.musicxml</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.musicxml.org/</string>
            <key>UTTypeDescription</key>
            <string>MusicXML</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>mxl</string>
                </array>
                <key>public.mime-type</key>
                <array>
                    <string>application/vnd.recordare.musicxml</string>
                </array>
            </dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>
        </dict>
        <dict>
            <key>UTTypeDescription</key>
            <string>Midi</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>mid</string>
                </array>
                <key>public.mime-type</key>
                <array>
                    <string>audio/midi</string>
                </array>
            </dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>
            <key>UTTypeIdentifier</key>
            <string>public.data</string>
        </dict>
    </array>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.xml</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>MusicSheet</string>
        </dict>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>CFBundleTypeName</key>
            <string>MusicSheet</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.recordare.musicxml</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>CFBundleTypeName</key>
            <string>MusicSheet</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.recordare.musicxml.uncompressed</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>PDF</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.adobe.pdf</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>Midi</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
            </array>
        </dict>
    </array>
    <key>MinimumOSVersion</key>
    <string>9.3</string>
    <key>UIAppFonts</key>
    <array>
        <string>Fonts/companySymbols.ttf</string>
        <string>Fonts/webhostinghub-glyphs.ttf</string>
    </array>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
        <integer>2</integer>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>CFBundleIdentifier</key>
    <string>com.company.test1</string>
    <key>XSAppIconAssets</key>
    <string>Resources/Images.xcassets/AppIcons.appiconset</string>
    <key>CFBundleShortVersionString</key>
    <string>1.2.0</string>
    <key>CFBundleName</key>
    <string>Test1</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>microphone use</string>
    <key>CFBundleDisplayName</key>
    <string>Test1</string>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>XSLaunchImageAssets</key>
    <string>Resources/Images.xcassets/LaunchImage.launchimage</string>
    <key>CFBundleVersion</key>
    <string>16</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
    </array>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.company.test1</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb899828993298981</string>
                <string>com.company.test1</string>
                <string>com.googleusercontent.apps.989898989981191-232111s4lsf441cu94</string>
            </array>
            <key>CFBundleURLTypes</key>
            <string>Viewer</string>
        </dict>
    </array>
</dict>
</plist>
EN

回答 2

Stack Overflow用户

发布于 2018-05-31 06:00:38

您是否设置了一个UTTypeTagSpecification来列出与com.recordare.musicxml关联的文件扩展名?我没有在你的截图中看到这个(但我对Xamarin UI也不太熟悉)

票数 0
EN

Stack Overflow用户

发布于 2018-10-25 19:00:40

我无法帮助Xamarin,但是MusicXML 3.1添加了官方的UTI。此更改列在MusicXML 3.1社区组https://www.w3.org/2017/12/musicxml31/报告中。您可以在https://github.com/w3c/musicxml/blob/gh-pages/schema/container.dtd找到它们的文档。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50601720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档