试过这个
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
webView.Source = "https://www.example.com/";
webView.Navigating += WebView_Navigating;
}
private void WebView_Navigating(object sender, WebNavigatingEventArgs e)
{
// Set the User-Agent string to a desktop browser user agent
webView.Eval("navigator.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'");
}
}
请帮助在更改到桌面模式使用Xamarin
1条答案
按热度按时间nr7wwzry1#
在Android中,您必须实现自定义渲染器。
在Android文件夹中创建自定义渲染器(DesktopWebViewRenderer.cs):