Incorrect width in Android webkit browser

后端 未结 3 2011
清酒与你
清酒与你 2020-12-31 13:17

I noticed a problem on Android\'s default browser, where 100% width may actually go past the edge of the screen. Here\'s a minimal test case:

  
3条回答
  •  情深已故
    2020-12-31 13:36

    In my WebView, I was able to fix the widths by turning off wide viewport.

    webview.getSettings().setUseWideViewPort(false);
    

    This disables horizontal scroll unless absolutely necessary, and div widths and zoom work as expected. Obviously this will only work with a custom WebView, maybe there is a more generic way to do this with something like ?

提交回复
热议问题