Implement transparent navigation bar and status bar on Android 4.4 Translucent system Bar

Source: Internet
Author: User

Get  out New  is shown behind the system bars. A typical use- case would is an app for needs to show through to a wallpaper.

This is the original text on Android developer anyway, I don't know what I'm aware of. Implementation and transparency with the navigation bar and status bar some gradient effects

1. Setting the theme
<style name="theme.timetodo" parent="@android: Style/theme.holo.light  ">    <!--Translucent system bars---    <item name="android: Windowtranslucentstatus">true</item>    <item name="  Android:windowtranslucentnavigation">true</item></style>

After adding these two properties it is the effect that you can see the ListView has been top to go up to do not know whether the bug checked the information the current solution seems to be to set layout padding to solve

2. Set the color and settings padding
Private voidInitsystembar () {if(Build.VERSION.SDK_INT >=Build.version_codes. KITKAT) {Settranslucentstatus (true); Systembartintmanager Tintmanager=NewSystembartintmanager ( This); Tintmanager.setstatusbartintenabled (true);        Tintmanager.setstatusbartintresource (R.COLOR.ACTIONBAR_BG); Systembarconfig Config=Tintmanager.getconfig (); Listviewdrawer.setpadding (0, Config.getpixelinsettop (true),0, Config.getpixelinsetbottom ()); }}
3. Final effect

Resources:

http://mindofaandroiddev.wordpress.com/2013/12/28/ making-the-status-bar-and-navigation-bar-transparent-with-a-listview-on-android-4-4-kitkat/

Http://stackoverflow.com/questions/20781014/translucent-system-bars-and-content-margin-in-kitkat

Implement transparent navigation bar and status bar on Android 4.4 Translucent system Bar

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.