Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已将WebView其添加到正在运行的活动之上。我喜欢这个 WebView 总是以纵向显示,所以如果应用程序是横向的,我会旋转它,但是调用setRotation()会导致WebView变为空白,即将旋转设置为任何非 0 的值会导致页面显示为空白。
WebView
setRotation()
我不太确定发生了什么(我以前认为页面只是显示在屏幕外,但对于最小的值它也是空白的),但是有没有办法解决这个问题?
我的朋友找到了答案。您必须关闭硬件加速。
webViewInfo.setLayerType(View.LAYER_TYPE_SOFTWARE, null);