Hide the title bar and status bar of an Android app
In order to beautify the interface of the program, we hope to hide the TitleBar of the application. The commands found on the Internet have a good effect. The second method is recommended, which is clear at a glance.
Method 1: Add the following code in onCreate
// Do not display the title bar
This. requestWindowFeature (Window. FEATURE_NO_TITLE );
// Do not display the status bar
This. getWindow (). setFlags (WindowManager. LayoutParams. FLAG_FULLSCREEN, WindowManager. LayoutParams. FLAG_FULLSCREEN );
Method 2: Add the following code to the activity corresponding to the list (AndroidManifest. xml ):
// Do not display the title bar
Android: theme = "@ android: style/Theme. NoTitleBar"
// Do not display the status bar
Android: theme = "@ android: style/Theme. NoTitleBar. Fullscreen"
Data Source