OGeek|极客世界-中国程序员成长平台

标题: ios - 注册以使用 iOS 应用程序支持图像文件 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 11:34
标题: ios - 注册以使用 iOS 应用程序支持图像文件

您好,我想注册以支持我的应用中的图像文件;因此,当用户点击 iPhone 的照片应用程序中的操作按钮时,我的应用程序图标将显示在“打开方式...”菜单中。我的 info.plist 中有以下内容

<dict>
   <key>LSHandlerRank</key>
   <string>Alternate</string>
   <key>LSItemContentTypes</key>
     <array>
        <string>public.png</string>
     </array>
</dict>


<dict>
   <key>LSHandlerRank</key>
   <string>Alternate</string>
   <key>LSItemContentTypes</key>
      <array>
         <string>public.jpeg</string>
      </array>
</dict>

但无法让它显示在该菜单中。这是正确的方法吗?请帮忙谢谢!!



Best Answer-推荐答案


试试这个对我有用

    <key>CFBundleDocumentTypes</key>
    <array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>png</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.png</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeName</key>
        <string>jpeg</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.jpeg</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeName</key>
        <string>tiff</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.tiff</string>
        </array>
    </dict>
    </array>

此链接中的更多信息 http://lists.apple.com/archives/cocoa-dev/2006/Jun/msg00747.html

关于ios - 注册以使用 iOS 应用程序支持图像文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16939288/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4