装载Webview是不填充设备屏幕? [英] Loading Webview is not filled with device screen?
本文介绍了装载Webview是不填充设备屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个web视图问题。它不是装载全屏。我试图从计算器后的所有答案,但没能解决我的问题(的WebView宽度和高度匹配父/填充母我想这两个)
I have a problem with webview. It is not loaded with full screen. I have tried all post answer from stackoverflow but couldn't solve my problem (webview width and height are match-parent/fill-parent i tried for both)
我在HTML中使用这种
I am using this in html
<meta content="height = device-height,width = device-width, initial-scale = 1.0, minimum-scale = 1.0,maximum-scale = 2.0, target-densitydpi = dpi_value"/>
和在code正在设置在地图设置,以及
And in code am setting the map settings as well
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);
我与支持受审清单中所有画面像
I have tried with support for all screens in manifest like
<supports-screens android:smallScreens="true"
android:normalScreens="true" android:largeScreens="true"
android:anyDensity="true" />
我加载从服务器中添加图像(图像尺寸是800x720)。只有像我加载不是任何其他数据。
I am loading the add image from server (image size is 800x720). and only image i am loading not any other data.
推荐答案
在您的WebView设置添加此命令
Add this command in your webview settings
webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setJavaScriptEnabled(true);
这篇关于装载Webview是不填充设备屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文