First introduce the method of removing the title bar:
The first type: A method commonly 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 the equivalent of a topic, and then define it in the Androidmanifest.xml file.
<android:icon= "@drawable/icon" android:label= "@string/app_ Name " android:theme=" @style/notitle ">
This can also be achieved by removing the title bar effect
Summary of three ways to remove the title bar
First, sometimes we will see that the title bar will appear first, and then disappear, because we are only defined in the activity of the OnCreate method, the second relative to the first is better, do not appear this situation, the third I personally feel the best, so that the function is separate, easy to maintain and expand
Introduction to the full-screen method
The first type:
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
The second type:
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
The third type:
<android:icon= "@drawable/icon" android:label= "@string/app_ Name " android:theme=" @style/fullscreem "/>
Source:Full screen or cancel title bar in Android