First study Date: 2016/7/30
First, head title cancellation
Current version new project the default theme in application is Android:theme= "@style/apptheme", which exists in Res/values/styles.xml code, which may be different when created by default
<!--Base application theme. - <stylename= "Apptheme"Parent= "Theme.AppCompat.Light.DarkActionBar"> <!--Customize your theme here. - <Itemname= "Colorprimary">@color/colorprimary</Item> <Itemname= "Colorprimarydark">@color/colorprimarydark</Item> <Itemname= "Coloraccent">@color/coloraccent</Item> </style>
To cancel the title way:
1, all the cancellation of the theme, android:theme= "" Input @style/no query, here appear the following three, should choose which can, and so do not change
Android:theme= "@style/theme.appcompat.daynight.noactionbar" android:theme= "@style/ Theme.AppCompat.Light.NoActionBar "Android:theme=" @style/theme.appcompat.noactionbar "
View Code
2, a single cancellation of the theme, is in the <activity note also exists android:theme= "", the value in the same ibid
To remove the title from your code and use it in Android studio, Eclipse looks at the code below:
// please write the following code in front of Setcontentview () supportrequestwindowfeature (window.feature_no_title);
View Code
Use this in eclipse
Requestwindowfeature (Window.feature_no_title);
View Code
With the cancellation of the header status bar code, the status bar is the top of the small black bar, showing the time, power, and so on, finger hold down can drop, eclipse the same
// also written on Setcontentview () this. GetWindow (). SetFlags (Windowmanager.layoutparams.flag_fullscreen,windowmanager.layoutparams.flag_ fullscreen);
View Code
And the use of the following labels on the internet to eliminate the title and status bar at the same time only when the file extends activity is useful, in the inheritance of appcompatactivity or actionbaractivity flashback, the reason please see the link
Http://www.eoeandroid.com/thread-559545-1-1.html?_dsign=51bbc2e6
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
View Code
Second, the title bar design
Android Studio Activity Title Research