注册应用程序以打开图像文件 [英] Register app to open image files

查看:115
本文介绍了注册应用程序以打开图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功注册我的应用程式,在我的info.plist中加入以下内容,以开启PDF档案:

I have successfully registered my app to open PDF files by including the following in my info.plist:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>PDF</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.adobe.pdf</string>
        </array>
    </dict>
</array>

但是,我似乎无法注册我的应用程序打开任何图像文件,我试图注册不仅用于基本图像UTI,还有像png和jpg的特定类型。是否可以注册打开图片文件?

However, I cannot seem to register my app to open any image files, I have tried to register not only for the base image UTI, but also specific types like png and jpg. Is it possible to register to open image files?

推荐答案

打开plist并添加源代码。

open plist with Source code and add this for document.

<dict>
            <key>CFBundleTypeName</key>
            <string>All Files</string>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
        </dict>

我希望对你有用。

这篇关于注册应用程序以打开图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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