Overlay action bar with a translucent status bar

后端 未结 3 1156
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 16:01

I\'m trying to achieve the effect shown here: http://www.youtube.com/watch?v=6QHkv-bSlds&t=15m48s by Nick and the boys. I can get the action bar to be overlayed, but can

3条回答
  •  猫巷女王i
    2020-12-29 16:10

    They are using the new Translucent system bars feature (on Android 4.4 and up).

    Translucent system bars

    You can now make the system bars partially translucent with new themes, Theme.Holo.NoActionBar.TranslucentDecor and Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable fitsSystemWindows for the portion of your layout that should not be covered by the system bars.

    If you're creating a custom theme, set one of these themes as the parent theme or include the windowTranslucentNavigation and windowTranslucentStatus style properties in your theme.

提交回复
热议问题