在 Xamarin Forms 中,我添加了一个手势识别器,让用户点击电子邮件地址标签并打开电子邮件应用程序。
在 Android 上这可行,用户被询问他们想在 gmail 或电子邮件应用程序中打开,但在 ios 上没有任何反应。
我必须做一些特定于 ios 的事情来处理这个问题吗?
var emailGestureRecognizer = new TapGestureRecognizer();
emailGestureRecognizer.Tapped += (s, e) =>
{
Device.OpenUri(new Uri("mailto:" + venue.ContactEmail));
};
ContactLabel.GestureRecognizers.Add(emailGestureRecognizer);
最佳答案
基于Apple documentation , 这是正确的。
iOS Note: If the Mail app is not installed, clicking a mailto URL displays an appropriate warning message to the user.
由于模拟器上没有安装邮件(和电话,可能还有其他)应用程序,这些链接将不起作用。
关于c# - Xamarin Forms - 单击包含电子邮件地址的标签并在电子邮件应用程序中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51499887/