开发者

Android Webview not resizing consistently when data is changed

开发者 https://www.devze.com 2023-01-30 07:28 出处:网络
I am using the same Webview multiple times. When I load html that takes up more space, the webview expands to fit it, but once in 开发者_运维问答awhile, it doesn\'t shrink back when less content is lo

I am using the same Webview multiple times. When I load html that takes up more space, the webview expands to fit it, but once in 开发者_运维问答awhile, it doesn't shrink back when less content is loaded into it again. How can I make this behavior more consistent?


I just solved this problem, you can call new WebView(context) , then call webview.loadData(..), and add it to container layout every time when you have to reload a new data.

Don't define webview in xml(especially when scrollview is its parent), tried to add webview dynamically in code.

0

精彩评论

暂无评论...
验证码 换一张
取 消