采用了半透明的状态条叠加操作栏 [英] Overlay action bar with a translucent status bar

查看:183
本文介绍了采用了半透明的状态条叠加操作栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在这里实现显示的效果:<一href="http://www.youtube.com/watch?v=6QHkv-bSlds&t=15m48s">http://www.youtube.com/watch?v=6QHkv-bSlds&t=15m48s尼克和孩子们。我可以将叠加的动作栏,但无法弄清楚如何将此扩展到状态栏。我也想知道他们是如何管理导航栏后面的透明黑色背景(但这不是至关重要)。

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 cannot figure out how to extend this to the status bar. I would also like to know how they managed the transparent black background behind the navigation bar (but this isn't as crucial).

任何帮助/建议将不胜AP preciated因为我现在不知道如何做到这一点(和我开始担心它可能只是一个图像,而不是实际的实现)。

Any help / advice would be greatly appreciated as I currently have no idea how this is done (and am starting to worry it may just be an image rather than an actual implementation).

编辑:我知道如何使酒吧完全透明(这就是最简单的部分)!我不知道如何扩展动作条背景下出现的,现在半透明的状态栏后面

i know how to make the bars fully transparent (thats the easy part)! I dont know how to extend the actionbar background to appear behind the now transluscent status bar

推荐答案

我有同样的问题,发现这个库:的https:// github上.COM / jgilfelt / SystemBarTint

I had the same question and found this library: https://github.com/jgilfelt/SystemBarTint

看一看在第300行: <一href="https://github.com/jgilfelt/SystemBarTint/blob/master/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java">https://github.com/jgilfelt/SystemBarTint/blob/master/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java

Have a look at line 300 in: https://github.com/jgilfelt/SystemBarTint/blob/master/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java

setupStatusBarView()添加一个视图窗口的装饰。这使您可以稍后设置彩色/绘制这一观点。

setupStatusBarView() Adds a view to the window's decor. This allows you to later set a color/drawable to this view.

如果使用的 SystemBarTint 库,下面将允许您强制状态栏以指定的颜色,然后你就可以匹配你的动作条的背景:

If using the SystemBarTint library, the following will allow you to force the status bar to a specified color, which you can then match to your action bar's background:

SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(Color.parseColor("#DD000000"));

在这种情况下,你会设置你的动作条的背景:#DD000000

In this case you would set your action bar's background to: #DD000000

这篇关于采用了半透明的状态条叠加操作栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆