Hide title bar
Method "1", add requestwindowfeature (window.feature_no_title) to the activity's OnCreate () method;
That is: (remember: This code should be written in front of Setcontentview ())
void onCreate (Bundle savedinstancestate) { ... Requestwindowfeature (window.feature_no_title); ...}
Method "2", in the configuration file Androidmanifest.xml, the key is Android:theme= ""
(1) Hide the title bar of the entire project:
-the theme here refers to the system's own style
<application android:icon= "@drawable/icon" android:label= "@string/app_name" android:theme= "@android: Style/theme.notitlebar" >
--the theme here refers to a custom style
First add it in the Style.xml.
<?xml version= "1.0" encoding= "UTF-8"?> <resources> <style name= "Mystylenotitle" > <item name= "Android:windownotitle" >true</item> </style> </resources >
And then refer to it in Androidmanifest.xml.
<application android:icon= "@drawable/icon" android:label= "@string/app_name" Android:theme= "@style/mystylenotitle" >
(2) Hide the title bar of an activity:
<activity android:name= "package path for a acivity" android:label= "@string/app_name" Android:theme= "@android: Style/theme.notitlebar"//the theme here can be customized
</activity>
Hide the Android title bar