System UI (Statusbar and Navigation Bar) render artifact [duplicate]

六眼飞鱼酱① 提交于 2019-12-08 03:23:59

问题


I have a full screen video using Exoplayer in a FullScreenActivity where status bar and navigation bar are hidden (from android >= 4.4).

When the activity is finished, I go back to last activity which is NOT a fullscreen (system ui is displayed) and 70% of the time I'm having a really strange issue on the system UI as follow :

Note that the image is the original one, so the white space on the right of the navigation bar is displayed on the phone.

This artefact disappear when another video play of when resuming the app. The top artifact correspond to the Toolbar + status bar. The artifact appear when fullscreen activity is fully fade out and finished.

Any sugestion or code request is welcome.


回答1:


There is a known bug in WebView (at least since KitKat) that sometimes causes these artifacts. It was filed in the Android bug tracker as this issue. Although they claim it's fixed in Android 5.0, that is not the case, though (at least from my experience) it's not quite as easy to reproduce as before.

In any case, the workaround is to use software rendering for the WebView, via setLayerType():

webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Some related questions:

  • Android SystemUI glitches in Lollipop
  • FlipAnimation causing issue in 4.4.3

If you have a self-contained example that reproduces the bug, I would be very grateful if you could provide it to the guys at the AOSP Issue Tracker, in the link above.




回答2:


This might be rendering problem and has been reported here

Setting your WebView like so:

yourWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

can solve your problem.



来源:https://stackoverflow.com/questions/28237090/system-ui-statusbar-and-navigation-bar-render-artifact

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!