Alibabacloud.com offers a wide variety of articles about android status bar height xml, easily find your android status bar height xml information here online.
above, the effect of this article is only effective at 4.4 and above.
First, apply the topic
data-snippet-id=ext.7aa43b0f8d91da8238f865c9576446df data-snippet-saved=false data-codota-status=done>
Then we create a values-v19 directory under res, representing the lowest API is 19, create a style. xml, the following code is the key to transparent Status
(Build.VERSION.SDK_INT >= build.version_codes.
KitKat) {window window = Context.getwindow (); Window.setflags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT
_status);
int statusbarheight = Getstatusbarheight (Context.getbasecontext ());
View.setpadding (0, statusbarheight, 0, 0); }/** * is used to get the height of the status
1. Hide the title bar // hide the title bar this. requestwindowfeature (window. feature_no_title); 2. Hide the status bar // hide the status bar this. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowman
To hide the title bar, use the predefined style android: theme = "@ android: style/Theme. NoTitleBar ".Hide the status bar: android: theme = "@ android: style/Theme. NoTitleBar. Fullscr
Hide the title bar and status bar of an Android app
In order to beautify the interface of the program, we hope to hide the TitleBar of the application. The commands found on the Internet have a good effect. The second method is recommended, which is clear at a glance.
Method 1: Add the following code in onCreate
the API is differentiated above.
Note: The following style style is the same as the code, but with compatibility issues, it is recommended to use code settings directly
The second step-padding out the reserved spaceAfter you set the transparency status bar, the content will top to the top of the screen and overlap the contents of the status bar.You
); } }Note that the flag identifies the API version number 19, which means that only the transparent status bar can be implemented above api>=19, which is why the API is differentiated above.
Note: The following style style is the same as the code, but there are compatibility issues. It is recommended to use code settings directly
The second step-padding out the reserved spaceAfter y
adjust the height of toolbar (ActionBar). You need to add the height of the system status bar to toolbar, because if you set up the first two steps, the toolbar will move up to the status bar,Method One: The way I prefer to do th
1. Set in the code
Public void oncreate (bundle savedinstancestate ){Super. oncreate (savedinstancestate );// Remove titleRequestwindowfeature (window. feature_no_title );// Remove the status bar above the activityGetwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );Setcontentview (R. layout. Main );}
Or
Requestwindowfeature (window. feature_cu
This article mainly introduces the Android implementation of the hidden status bar and the title bar of the relevant information, the need for friends can refer to the
To hide the title bar you need to use a predefined style: Android:theme= "@
Http://www.cnblogs.com/zhuguangwei/archive/2011/01/18/1938276.htmlFirst, hide the title barHide title barThis.requestwindowfeature (Window.feature_no_title);Second, hide the status barHide the status barThis.getwindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_ fullscreen);Third, remove the title bar of all activity
. KITKAT) { //transparent status bar window.addflags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); Transparent navigation bar window.addflags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); Set Contentview to Fitssystemwindows viewgroup Contentview = (viewgroup) Findviewbyid (
1. Hide the title bar
Copy codeThe Code is as follows: // hide the title bar this. requestWindowFeature (Window. FEATURE_NO_TITLE );
Ii. Hide the status barCopy codeThe Code is as follows: // hide the status bar this. getWindow (). setFlags (WindowManager. LayoutParams. FL
To hide the title bar you need to use a predefined style: Android:theme= "@android: Style/theme.notitlebar".Hide status bar: Android:theme= "@android: Style/theme.notitlebar.fullscreen".
@Override public
void OnCreate (Bundle savedinstancestate) {
First, hide the title bar
Copy Code code as follows:
Hide title bar this.requestwindowfeature (Window.feature_no_title);
Second, hide the status bar
Copy Code code as follows:
Hides the status bar This.get
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.