Cancel the title bar in full screen mode in Android, and set notitlebar in tabhost.
The default title bar of Android is relatively difficult to control. You need to remove the custom title bar.
Remove the title bar:
First: this is also a common method for getting started.
Requestwindowfeature (window. feature_no_title); // remove the title bar.
Note that this sentence must be written before the setcontentview () method. Otherwise, an error will be reported.
Type 2: defined in the androidmanifest. xml file
<Application Android: icon = "@ drawable/icon"
Android: Label = "@ string/app_name"
Android: theme = "@ Android: style/theme. notitlebar">
As you can see, the title bar will be removed for the entire application. If you only want to remove the title bar of an activity, you can add this attribute to the activity tag.
Note: This method does not work on the tabhost on the Samsung i9300 mobile phone of android4.1.1. You need to add settheme to the first method for control.
Settheme (Android. R. style. theme_black_notitlebar );
Requestwindowfeature (window. feature_no_title );
Setcontentview (R. layout. api_tab_host );
Third: Custom styles, which are not commonly used in general applications. Create a style. xml file under the Res/values directory.
For example:
<? XML version = "1.0" encoding = "UTF-8"?>
<Resources>
<Style name = "notitle">
<Item name = "Android: windownotitle"> true </item>
</Style>
</Resources>
It is equivalent to a topic and then defined in the androidmanifest. xml file.
<Application Android: icon = "@ drawable/icon"
Android: Label = "@ string/app_name"
Android: theme = "@ style/notitle">
Removed the title bar.
First, we can see that the title bar appears first and then disappears, because it is defined in the oncreate method of activity.
The second one is better than the first one, so this will not happen.
The third method can separate functions to facilitate maintenance and expansion, but it is troublesome.
------------------------------------------------------
Full Screen:
First
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );
Second
Android: theme = "@ Android: style/theme. notitlebar. fullscreen"
third
application Android: icon = "@ drawable/icon"
Android: Label = "@ string/app_name"
Android: theme = "@ style/fullscreem"