显示状态栏上方的视图? [英] Display view above status bar?
问题描述
我最近看到一个能够在状态栏上方显示视图的应用程序的图像,并且还可以通过视图来覆盖它。
I recently saw an image of an app that was capable of displaying a view above the status bar and was also able to cover it with a view.
我知道您可以从状态栏的正下方得到一个视图,从一个视图与对齐父顶部。但是如何在状态栏的顶部获得一个视图?
I know you can get a view right below the status bar from a view with align parent top. But how would you get a view on top of the status bar??
推荐答案
@Sadeshkumar的答案不正确ICS和以上(也许是GB)。
The answer by @Sadeshkumar is incorrect for ICS and above (perhaps GB as well).
使用 TYPE_SYSTEM_ALERT
和 FLAG_LAYOUT_IN_SCREEN
由 StatusBar
覆盖。
要获得叠加层 StatusBar
,您需要使用 TYPE_SYSTEM_OVERLAY
而不是 TYPE_SYSTEM_ALERT
。
To get an overlay on top of the StatusBar
, you need to use TYPE_SYSTEM_OVERLAY
instead of TYPE_SYSTEM_ALERT
.
现在的问题是如何获得点击/触动?
The problem being then, how to get clicks/touches?
这篇关于显示状态栏上方的视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!