IOS 8在我的应用程序中从其他应用程序打开图像 [英] IOS 8 open image in my app from another apps

查看:132
本文介绍了IOS 8在我的应用程序中从其他应用程序打开图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些研究,但似乎仍然没有运气

I did some research but seems still no luck

当我在我的info.plist中添加这些xml

when I added these xml in my info.plist

<key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeIdentifier</key>
            <string>my.custom.uti</string>
            <key>UTTypeDescription</key>
            <string>PDF file</string>
        </dict>
    </array>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
            </array>
            <key>CFBundleTypeIconFile</key>
            <string>Icon.png</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleTypeName</key>
            <string>my.custom.uti</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
        </dict>
    </array>

我发送3封电子邮件给自己。
1 - pdf文件。
2 - png文件。
3 - jpg和png文件。

and I send 3 email to myself. 1 - pdf file. 2 - png file. 3 - jpg and png file.

当我添加这些xmls时,我的应用程序可以在pdf和txt文件中显示,当点击打开...时
但我想要的是在图像中打开。
出了什么问题?
和我设置UITTypeConformsTo = public.data假设它是一般值。所以我的应用程序可以打开所有格式(至少pdf和图像),但似乎不。

when i added these xmls, my app can shows in pdf and txt file, when clicked "open with..." but what I want is open with in images. anything goes wrong?? and I set UITTypeConformsTo = public.data suppose that it is a general value. So that my app can open all the formats(at least pdf and images) , but seems it dont.

我也尝试将此答案中的xml复制到我的info.plist
https://stackoverflow.com/a/11609935/1061074 仍然没有运气

I also try to copy the xml in this answer to my info.plist https://stackoverflow.com/a/11609935/1061074 still no luck

推荐答案

它一切都取决于主机应用程序中共享按钮的实现方式。在iOS8中,实际上有两种不同的方法:(1)在Info.plist中使用CFBundleDocumentTypes,以及(2)应用程序扩展。一些应用程序,如GMail& AVR支持(1)和(2)。但Dropbox仅支持(2)。这就是为什么CFBundleDocumentTypes不再适用于Dropbox的原因。当然,事情可能会在以后发生变化。

It all depends on how "share" button in the host app is implemented. In iOS8, there are actually two different ways to do this: (1) using CFBundleDocumentTypes in Info.plist, and (2) Application Extension. Some apps such as GMail & AVR support both (1) & (2). But Dropbox supports (2) only. That's why CFBundleDocumentTypes does not work in Dropbox anymore. Of course, things may change later.

这篇关于IOS 8在我的应用程序中从其他应用程序打开图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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