我有一个 webview,我想设置它的比例
但是无论我放 setinitialscale(50) 还是 setinitialscale(300),setinitialscale 都会失败
如果我加载外部网站,Setinitialscale 工作。
但不适用于在资产中加载本地 html 文件。
这与我加载的网页的 html 有关吗?有人对此有想法吗?
mWebView = (WebView) view.findViewById(R.id.webview);
websettings = mWebView.getSettings();
websettings.setLoadWithOverviewMode(true);
websettings.setUseWideViewPort(true);
mWebView.setInitialScale(1);
html如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="">
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script src="scripts/jquery-1.8.2.min.js"></script>
<script src="scripts/main.js"></script>
</head>
<body>
<div class="contentContainer">
<div class="titleHeader fontSize"><div class="boxContent">Diabetic Foot Problems
</div>
</div>
<div class="txtContent fontSize marginLR">
<b>Management</b><br/>
<li>Advise on proper footwear</li>
<li>Discuss the need for additional support</li>
<li>Treat all skin infections( frequent wound dressing/ debridement/ administration of broad spectrum antibiotics)</li>
<li>Perform annual assessment</li>
</div>
</div>
</body>
</html>