显示状态栏上方的视图? [英] Display view above status bar?

查看:157
本文介绍了显示状态栏上方的视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近看到一个能够在状态栏上方显示视图的应用程序的图像,并且还可以通过视图来覆盖它。

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屋!

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