Reprinted blog: http://www.2cto.com/kf/201503/381348.html
Android4.4 new features, System status bar integration.
The steps to be implemented include the following:
1.android4.4 or later
2. Set the app fullscreen:
Method: Set Android:theme= "@android: Style/theme.translucent.notitlebar" in Androidmanifest.xml
3. Load Nineoldandroids-2.4.0.jar
4. Implementation class: Set the status bar background to full transparency.
The project structure diagram is as follows:
The main method of invocation is implemented in Mainactivity.java as follows:
Public classmainactivity extends activity{@Overrideprotected voidonCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Settranslucentstatus (); Setcontentview (R.layout.activity_main); } /** * Set status bar background status*/ Private voidSettranslucentstatus () {if(Build.VERSION.SDK_INT >=Build.version_codes. KITKAT) {Window win=GetWindow (); Windowmanager.layoutparams Winparams=win.getattributes (); FinalintBITS =WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; Winparams.flags|=bits; Win.setattributes (Winparams); } Systemstatusmanager Tintmanager=NewSystemstatusmanager ( This); Tintmanager.setstatusbartintenabled (true); Tintmanager.setstatusbartintresource (0);//status bar no background }}
Note: This is a new feature of android4.4 and supports only 4.4 or more versions
Here are the following:
Resource Address: Http://pan.baidu.com/s/1o6pbfIU
Android immersive notification bar design