Xamarin Forms,iOS 不会在 WebView 中打开链接 [英] Xamarin Forms, iOS will not open links in WebView

查看:51
本文介绍了Xamarin Forms,iOS 不会在 WebView 中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Xamarin Forms 应用程序,它使用 webview 将外部网页加载到其中.该网页具有应用程序需要访问的链接.Android 打开链接很好,但 iOS 没有.我试过使用 Device.OpenUri(new Uri(e.Url));但这会在 web 视图中打开 Safari 中的链接.我只希望我点击的链接在 webview 中打开.

I have a Xamarin Forms application using webview to load an external web page into it. The web page has links that the application needs to access. Android opens the links just fine but iOS does not. I've tried using Device.OpenUri(new Uri(e.Url)); but that opens the link in Safari within the webview. I only want the link that I clicked on to open in the webview.

推荐答案

发现问题.我的问题与 iOS 不允许没有 https 的网站有关.例如,如果链接使用 google.com 而不是 https://google.com,应用将不允许这样做.

Found the issue. My problem had to do with iOS not allowing website without https. For example if a link had google.com instead of https://google.com the app wouldn't allow it.

这篇关于Xamarin Forms,iOS 不会在 WebView 中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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