WebView在0.1-0.5%的情况下为空。滚动屏幕(CoordinatorLayout)或切换到其他应用并返回后,将显示内容。
试图通过检查WebView( Bitmap.createBitmap(view.getDrawingCache()))的空屏幕截图来检测这种情况,但该警告应在出现后0.5秒钟进行,但它始终有效。但是,获得有效的屏幕快照后,它在显示屏上仍然为空。 (也尝试获取完整屏幕的屏幕快照,这也总是有效的。)
疲倦于跟踪转储布局层次结构,坐标看起来类似于出现内容时的情况。
在错误发生之前,早先使用同一WebView数百次都没有问题。先前的内容会按原样消失,但不会呈现新内容。
布局:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:visible_or_gone="@{data.state == ViewState.QUESTION}">
<WebView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:html_data="@{data.renderQuestion}"/>
时间轴:
所有更新都是在UI线程中完成的。
发现我并不孤单,但无法从以下链接中找到解决方案: https://bugs.chromium.org/p/chromium/issues/detail?id=474167