当文本长于屏幕宽度时,为什么 WebView 无法正常工作?

Why WebView not working correctly when the text is longer than the width of the screen?

当文本长度超过屏幕宽度时,为什么 WebView 无法正常工作?

代码html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
</head>
<body style="margin: 0px; padding: 0px;">

<div>
<img align="left" src="file:///android_res/drawable/asd.png"/> Hello   asdasdsdsadadsasdsdasdasdasdassda
 </div>

 </body>
  </html>

Java Android

        WebView webview = (WebView)this.findViewById(R.id.webView);
        webview.loadUrl("file:///android_asset/index.html");

这是一个错误吗?

这是屏幕 http://pixs.ru/showimage/xJr0B1.jpg_1403285_16486028.png

webview没有bug。 您需要正确创建 HTML 页面。

为了确认,您可以尝试在长字之间添加一个 space。

此处的长字不适合图像的右侧,这就是它移到图像下方的原因