如何为多个图像扩展注册iOS应用? [英] How to register an iOS app for multiple image extensions?

查看:59
本文介绍了如何为多个图像扩展注册iOS应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的iOS注册为.jpg(.jepg)、. png和.gif的编辑器. 我尝试了下面的代码,但我的应用仅显示在扩展名的Open in iOS菜单中. 如何使它适用于其他两个扩展?

I would like to register my iOS as an editor for .jpg (.jepg), .png and .gif. I tried the code below but my app only shows up in the Open in iOS menu for the .jpeg extension. How to make it work for the other two extension?

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>public.jpeg</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.jpeg</string>
        </array>
    </dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>public.png</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.png</string>
        </array>
    </dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>GIF image</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.compuserve.gif</string>
        </array>
    </dict>
</array>

推荐答案

您只需要一个CFBundleDocumentTypes部分:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>public.jpeg</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.jpeg</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeName</key>
        <string>public.png</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.png</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeName</key>
        <string>GIF image</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.compuserve.gif</string>
        </array>
    </dict>
</array>

将这些详细信息输入Xcode,而不是手动编辑Info.plist.让它为您更新Info.plist.在文档类型"部分下针对目标的信息"选项卡上执行此操作.

Instead of manually editing Info.plist, enter these details into Xcode. Let it update Info.plist for you. Do this on the Info tab for your target under the "Document Types" section.

这篇关于如何为多个图像扩展注册iOS应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆