1. Implement in Code
This.requestwindowfeature (window.feature_no_title);//Remove the title bar, this refers to the current activity
This code must be preceded by Setcontentview ().
This . Requestwindowfeature (Window.feature_no_title); Setcontentview (r.layout.activity_main);
View Code
2. Implementation in the manifest file
<application android:icon= "@drawable/icon" android:label= "@string/app_name" android: Theme= "@android: Style/theme.notitlebar" >
View Code
This is set to the entire app is no title bar, if you need to be in an activity set to a untitled bar form, just put the above android:theme="@android: Style/theme.notitlebar" Write it into one activity.
3. Defined in the Style.xml file
<?xml version= "1.0" encoding= "UTF-8"?><resources> <style name= "Notitle" > <item name= " Android:windownotitle ">true</item> </style> </resources>
View Code
And then reference it in the manifest file.
<application android:icon= "@drawable/icon" android:label= "@string/app_name" android: Theme= "@style/notitle" >
View Code
<application android:icon= "@drawable/icon" android:label= "@string/app_name" Android:theme= "@style/notitle" >
View Code
In fact, the second and the third method are essentially the same, and the third one will be taller.
How Android apps get rid of the title bar