问题
By putting the following two lines of code in activity.OnCreate, I can get a full screen view:
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
However, if you look carefully, there is still a slight fading edge on the top edge of the screen which looks like a residue of the removed title bar. How can I get rid of that completely?
See this screen capture, which is a fullscreen view obtained using the above two lines of code, but the top fading edge is visible and annoying, I already tried android:fadingEdge="none" and android:fadingEdgeLength="0sp" on the root view of this activity, doesn't work:
回答1:
This will do what you asking for:
requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
来源:https://stackoverflow.com/questions/7524607/how-to-get-rid-of-top-fading-edge-in-android-full-screen-mode