WebView “disabled” in Windows 8.1

 ̄綄美尐妖づ 提交于 2019-12-11 23:34:13

问题


I just upgraded my app to Windows 8.1, but now pages that I am loading into the WebView are no longer interactive. I can't press any buttons or fill out any HTML form fields. My WebView looks like this

<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"></WebView>

回答1:


I just created a new Windows Store app for Windows 8.1 based on the Blank App (XAML) template only putting the following line inside the Grid of MainPage.xaml:

<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Source="http://www.quackit.com/html/codes/html_form_code.cfm" />

The HTML form controls behave as expected. Does this work for you? Do you have anything else on your page that could prevent interaction with HTML controls?

Maybe you have other (transparent) controls over the WebView. There's a change in z-ordering in Windows 8.1: in Windows 8 WebView was always rendered on top of other controls, now it can be rendered under other controls.




回答2:


I just put the WebView with an Rectangle in a Grid and it seems that all the inputs are captured by the Rectangle:

                <Grid>
                <WebView Name="ContentWebView" ScrollViewer.ZoomMode="Disabled" 
                     ScrollViewer.VerticalScrollBarVisibility="Disabled"
                     ScrollViewer.VerticalScrollMode="Disabled"
                     DefaultBackgroundColor="Transparent" Height="Auto" MinHeight="600" />
                <Rectangle Fill="Transparent"></Rectangle>

            </Grid>



回答3:


U should navigate webview or set source as explained above. Blank webview does not show anything

browser.navigate("http://example.com//");



来源:https://stackoverflow.com/questions/19434442/webview-disabled-in-windows-8-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!