为什么android中的webview会将图像加载到文本上? web=(WebView)findviewbyd(R.id.WebView); WebSettings WebSettings=web.getSettings(); webSettings.setTextSize(webSettings.TextSize.NORMAL); web.setBackgroundColor(0); webSettings.setLoadsImagesAutomatically(真); webSettings.setSupportMultipleWindows(真); webSettings.setSupportZoom(真); webSettings.SetBuilTinZoomControl(真); loadDataWithBaseURL(“,”“+desc+””,“text/html”,“utf-8”和“);

为什么android中的webview会将图像加载到文本上? web=(WebView)findviewbyd(R.id.WebView); WebSettings WebSettings=web.getSettings(); webSettings.setTextSize(webSettings.TextSize.NORMAL); web.setBackgroundColor(0); webSettings.setLoadsImagesAutomatically(真); webSettings.setSupportMultipleWindows(真); webSettings.setSupportZoom(真); webSettings.SetBuilTinZoomControl(真); loadDataWithBaseURL(“,”“+desc+””,“text/html”,“utf-8”和“);,android,webview,Android,Webview,` 我在webview中遇到了一个问题,当它加载图像时,它会加载到文本上,这会使文本损坏,如图像所示,因为我知道这两者都是通过连接到服务获得的 任何解决这个问题的方法这是安卓网络视图的问题,你可以通过将高度设置为标签来解决。 -->height=“imageHeight.”或等于其高度的边距底部。。 这不是一个好的解决方案,但这是我找到的唯一解决方案。您能否将您尝试过的方法进行编码。没有显示代码。这是一个简单的网络视图,我在其中加载html标记创建一个html文件并放入所有内容。尝试使用浏览器查

`

我在webview中遇到了一个问题,当它加载图像时,它会加载到文本上,这会使文本损坏,如图像所示,因为我知道这两者都是通过连接到服务获得的
任何解决这个问题的方法

这是安卓网络视图的问题,你可以通过将高度设置为标签来解决。 -->height=“imageHeight.”或等于其高度的边距底部。。
这不是一个好的解决方案,但这是我找到的唯一解决方案。

您能否将您尝试过的方法进行编码。没有显示代码。这是一个简单的网络视图,我在其中加载html标记创建一个html文件并放入所有内容。尝试使用浏览器查看它的外观。如果浏览器中的html文件看起来与android中的webview完全相同,那么问题在于html文件,您必须更改它。html在其他浏览器上正常工作!!
web= (WebView)findViewById(R.id.webview);
 WebSettings webSettings = web.getSettings();
    webSettings.setTextSize (WebSettings.TextSize.NORMAL) ;
    web.setBackgroundColor(0);
    webSettings.setLoadsImagesAutomatically(true);
    webSettings.setSupportMultipleWindows(true);
    webSettings.setSupportZoom(true);
    webSettings.setBuiltInZoomControls(true);

    web.loadDataWithBaseURL("", "<p dir=\"rtl\" align=\"right\">" + desc + "</p>", "text/html", "utf-8", "");