Full screen and remove title bar in Android
the method of removing the title bar
The First: a method that is often used when getting started
requestwindowfeature (window.feature_no_title); // Remove title bar
Note This sentence must be written in front of the Setcontentview () method, or it will be an error
the second type: defined in the Androidmanifest.xml file
<Application Android:icon="@drawable/icon"
Android:label="@string/app_name"
Android:theme = "@android: Style/theme.notitlebar">
As can be seen, the entire application will be removed from the title bar, if you want to remove the title bar of an activity, you can add this attribute to the activity tag
Third: This is not commonly used in general applications, is to create a new Style.xml file under the Res/values directory
For example:
<?XML version= "1.0" encoding= "UTF-8"?>
<Resources>
<stylename= "notitle">
<Itemname= "Android:windownotitle">true</Item>
</style>
</Resources>
in this way, we customize a style, which is equivalent to a topic, and then defined in the Androidmanifest.xml file, The effect of removing the title bar can also be achieved
<ApplicationAndroid:icon= "@drawable/icon"
Android:label= "@string/app_name"
Android:theme = "@style/notitle">
Summary of three ways to remove the title bar
the first kind, Sometimes we see that the title bar first appears, and then disappears, because we're just defining it in the OnCreate method of the activity.
the second kind, It's better than the first one, and it doesn't happen that way.
The Third Kind, personal feel is best, so the function is separated, easy to maintain and expand
"How to introduce full-screen"
First Kind
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
The second Kind
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
Third Kind
ApplicationAndroid:icon= "@drawable/icon"
Android:label= "@string/app_name"
Android:theme= "@style/fullscreem"
Full screen and remove title bar in Android