Android WebView: weird 1px line rendering on hdpi screens

I have a webview that displays some generated HTML. Content includes a list, and a CSS list element includes border-top: 1px.

On hdpi devices, WebView tries to scale this 1.5x line. Sometimes lines are rendered as one real pixel, and sometimes they are displayed as 2 real pixels. In fact, it seems to select 1 or 2 pixels alternately.

I am specifically looking for a solution that does not include <meta name="viewport" content="target-densitydpi=device-dpi" />. I want WebView to handle scaling if 1px rows are displayed sequentially.

+5
source share
2 answers

, , : WebView, CSS. , em px CSS.

0

- 1px, :

 -webkit-box-shadow:inset 0 1px 0 0 #000000;
 box-shadow:inset 0 1px 0 0 #000000;
0

All Articles