[通过我的应用以xamarin形式共享来自图库的图像

问题描述 投票:1回答:1

我想共享手机图库中的图像。我的应用应该在共享选项中。如何在Xamarin Forms中做到这一点。给我建议解决此问题

xamarin.forms visual-studio-2019 intentfilter
1个回答
0
投票

在Android中,将以下代码添加到Manifest.xml

<intent-filter . . . >
    <data android:mimeType="video/mpeg" android:scheme="http"  /> 
    <data android:mimeType="audio/mpeg" android:scheme="http"  />
    //. . . add all mimetype which your app support here
</intent-filter>

在iOS中

在Info.plist中添加以下代码。

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.item</string>
                <string>public.content</string>
            </array>
        </dict>
    </array>

有关更多类型,您可以检查System-Declared Uniform Type Identifiers

© www.soinside.com 2019 - 2024. All rights reserved.