How to get rid of the top edge of the attenuation in full screen android mode?

By putting the following two lines of code in activity.OnCreate, I can get the full screen:

requestWindowFeature (Window.FEATURE_NO_TITLE); getWindow (). setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

However, if you look closely, there is still a small fading edge on the top edge of the screen that looks like the rest of the removed title bar. How can I get rid of this completely?

See this screen capture, which is a full-screen view obtained using the two lines of code above, but the top edge of the fading is visible and annoying, I already tried android: fadingEdge = "none" and android: fadingEdgeLength = "0sp" in the root representation of this action, does not work: A fullscreen view with a green background, fading edge is visible

+5
source share
1 answer

This will do what you ask for:

requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
+3
source

All Articles