zoukankan      html  css  js  c++  java
  • UWP 解决Webview在Pivot里面无法左右滑动的问题

                    //为了解决webview在PivotItem里面,阻止pivot左右滑动。
                    if (webView != null)
                    {
                        rootGrid.Children.Remove(webView);
                        webView.NavigationCompleted -= webView_NavigationCompleted;
                        webView.NavigationFailed -= webView_NavigationFailed;
                        webView.NavigationStarting -= webView_NavigationStarting;
                        webView.DOMContentLoaded -= webView_DOMContentLoaded;
                        webView.ScriptNotify -= webView_ScriptNotify;
                    }
    
                    webView = new WebView(WebViewExecutionMode.SameThread);
                    webView.SetValue(Grid.RowProperty, 2);
                    webView.Visibility = Visibility.Collapsed;
                    webView.NavigationCompleted += webView_NavigationCompleted;
                    webView.NavigationFailed += webView_NavigationFailed;
                    webView.NavigationStarting += webView_NavigationStarting;
                    webView.DOMContentLoaded += webView_DOMContentLoaded;
                    webView.ScriptNotify += webView_ScriptNotify;
                    rootGrid.Children.Add(webView);

    标红的部分是必须的。解决方案就是手动加入webview并且使用

    WebViewExecutionMode.SameThread
  • 相关阅读:
    总结:多校1
    简易数论练习
    2017 多校1
    简易数论函数变换学习
    petrozavodsk1
    Permutacja
    图片上传阿里云oss 数据存入redis List
    tp5实现月统计数据
    es6 新特性
    es6 新特性总结
  • 原文地址:https://www.cnblogs.com/FaDeKongJian/p/5311397.html
Copyright © 2011-2022 走看看