How to make text fit to screen (text-wrap) in WebView with KitKat

后端 未结 2 1040
逝去的感伤
逝去的感伤 2021-02-14 10:03

I\'m having an issue in my WebView with Android 4.4. Before KitKat, text was fitting automatically with all devices resolutions in webviews. But today it\'s not fitting automati

2条回答
  •  抹茶落季
    2021-02-14 10:33

    If you can edit the html (using a simple string replace for instance), add the style word-wrap: break-word to the text container html element. e.g: If the top level element inside the body of the html is

    , change to

    . The webview will then wrap around the text and fit to screen.

提交回复
热议问题