Overlapping HTML content in WebView when using: webview.getSettings (). SetLayoutAlgorithm (LayoutAlgorithm.SINGLE_COLUMN);

Therefore, I am loading simple HTML code into a web view. Html is in the format: (it is extracted by html, so body tags are missing.

<p>..blah</p> 
<div style="text-align:center;">
<a href="http://services.runescape.com/m=rswikiimages/en/2012/5/combat1-18140712.jpg"    target="_blank">
<img src="http://services.runescape.com/m=rswikiimages/en/2012/5/combat1_thumb-18140804.jpg"></a></div>
<p>..blah</p>

In the webview activity class, I add:

webInfo = "<body style=\"color:white;font-size:15px\">" + webInfo + "</body>";
//for setting the size and color of the text

I use the following to download html:

webview.loadDataWithBaseURL(null,webInfo,"text/html","UTF-8",null);
// webInfo is an html string

and I do the following so that it does not scroll horizontally and that the image does not fit inside the screen.

webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);|

If I do not use SINGLE_COLUMN, I always scroll horizontally, even if the text fits well on the page. I thought this finally solved the problem, but I get overlapping html on load. This fixes itself if I slightly increase or decrease the fingers.

Here is a picture of what is happening:

enter image description here

1: , , ?

2: , , . , UTF-8, US-ACSII Windows-, , , , .

, , , O_O...

+3
1

-:

webSettings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING)// .

0

All Articles