且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

链接有时不工作的WebView

更新时间:2023-11-26 19:08:28

这似乎是一个可笑的变通方法,但我想它的工作原理。第一次的WebView加载,如果加载像

This seems like a ridiculous work around but I guess it works. The first time the WebView loads, if you load a blank dummy html file like

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

在你加载其它任何东西,这似乎解决这​​个问题。它也像假文件已完全加载第一,不只是开始加载。

before you load anything else, it appears to fix the problem. It also looks like the dummy file has to load completely first, not just start loading.