there is a way to activate a control WebView Desktop mode and not Mobile mode?

后端 未结 2 2136
感情败类
感情败类 2021-02-20 07:54

there is a way to activate a control WebView Desktop mode and not Mobile mode?


2条回答
  •  借酒劲吻你
    2021-02-20 08:31

    You can try adding a viewport meta tag with a "desktop" width to your , like:

    or



    Try this in order to set your user agent:~

    webView.SetWebViewClient (new MyWebViewClient());
    
    // ...
    
    public class MyWebViewClient : WebViewClient
    {
        public override bool ShouldOverrideUrlLoading(WebView view, string url)
        {
            view.Settings.UserAgentString = "your-user-agent-here";
            view.LoadUrl(url);
            return true;
        }
    }
    

提交回复
热议问题