Android webview issue with SINGLE_COLUMN mode

后端 未结 1 941
鱼传尺愫
鱼传尺愫 2020-12-18 10:50

I\'m currently having a issue with the Android WebView. This webview is currently initialized like this:

_post_WebView = (WebView) view.findView         


        
相关标签:
1条回答
  • 2020-12-18 11:36

    I finally went and solved it by using loadDataWithBaseURL(null, htmlString, "text/html", "utf-8", null) instead of loadData(htmlString,"text/html","utf-8") while adding a 100% max-width property and a auto width and height property to the iframes using CSS:

    htmlString = "<html><head><style>iframe {max-width: 100%; width:auto; height: auto;}</style></head><body>"+htmlString+"</body></html>";
    

    It's not the most clean way to do so, but it works.

    This method should also work if used with the layout algorithm NARROW_COLUMNS.

    0 讨论(0)
提交回复
热议问题