簡體   English   中英

Xamarin Forms - 如何使點擊 email 鏈接的用戶在 C7B83F57C37361AC7BA39 應用程序中打開 C7EBA39 應用程序

[英]Xamarin Forms - How to make it so that a user that clicks on a email link will open the email app in the device

我想這樣當我單擊 Xamarin Forms 中的(電子郵件鏈接)和(電話號碼)時,在用戶設備上啟動(電子郵件應用程序)和(電話應用程序)。

Xaml

<Label HorizontalTextAlignment="Start"
       Style="{StaticResource DescriptionLabelStyle}">
       <Label.FormattedText>
             <FormattedString>
                   <Span Text="{x:Static resources:Lang.AccessibilityRepDesc}" />
                         <Span Text="goteborg@goteborg.se" 
                               TextColor="{DynamicResource HyperLink}">
                                    <Span.GestureRecognizers>
                                        <TapGestureRecognizer Command="{Binding EmailCommand}" />
                                        </Span.GestureRecognizers>
                                    </Span>

                                    <Span Text="{helpers:Translate OrCall}" />

                                    <Span Text="031-3650000" 
                                          TextColor="{DynamicResource HyperLink}">
                                        <Span.GestureRecognizers>
                                            <TapGestureRecognizer Command="{Binding PhoneCommand}"/>
                                        </Span.GestureRecognizers>
                                    </Span>
                                </FormattedString>
                            </Label.FormattedText>
                        </Label>

代碼背后

private void EmailClicked(object obj)
{
     Console.WriteLine("Sending Email");
}

private void PhoneClicked(object obj)
{
     Console.WriteLine("Making a phonecall");
}

我可以通過關閉這篇文章來解決它

在 Nuget 上使用 (Xam.Plugins.Messaging) 非常容易修復。 我已經在 Android 上進行了測試,我還沒有在 iOS 上進行測試。

您可能正在尋找類似 Xamarin Essentials 之類的東西。 它有很多好的 API。 有一個電子郵件 API,您可以在這些文檔中閱讀有關它的信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM