如何在android中的每个视图顶部显示图像(例如,像市场上的碎屏应用程序)

发布于 2024-12-06 13:59:25 字数 623 浏览 7 评论 0 原文

我想创建类似 更好的破解屏幕

破裂的屏幕仍然是最重要的。

我不知道如何制作这种最重要的东西。

行为 : 例如,当显示破裂的屏幕时,如果我按主页按钮,它会显示主页,但破裂的屏幕保持原样(在主页顶部)..无论您移动到哪里都没关系..破裂的屏幕看起来完好无损..

到目前为止的搜索结果: Google API 演示:半透明 GLSurfaceView< /a>

谁能指导我如何完成这项任务?或者有人可以给我提供一个示例代码吗?

I want to create something like Better Cracked Screen.

The cracked screen remains top of everything.

I am not able to get how to make such thing which resides top of everything.

Behavior :
For example when cracked screen is displayed, and if i press home button then it shows me the home but the cracked screen remains as it is(here on top of home).. doesnot matter whereever you move.. cracked screen appears intact..

Search Results so far :
Google API Demos : Translucent GLSurfaceView

Can anyone guide me how can i achieve this task ? Or can anyone please provide me a sample code for this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

飘过的浮云 2024-12-13 13:59:25

使用 android.permission.SYSTEM_ALERT_WINDOW

这将允许您创建一个放置在所有应用程序窗口之上的窗口。这里的一个关键见解是,您无法在视图级别上工作来解决此问题。视图层次结构是在窗口内绘制的,因此要将某些内容放置在所有窗口之上,您需要另一个窗口。

Use android.permission.SYSTEM_ALERT_WINDOW.

That will allow you to create a window that is placed on top of all application windows. A key insight to have here is that you can not work on a View level to solve this. A View hierarchy is drawn inside a window, so to place something on top of all windows, you need another window.

溺渁∝ 2024-12-13 13:59:25

我猜它是一个 ImageView,作为 xml 文件的最后一部分创建(这意味着它位于堆栈顶部/所有其他元素之上)。并且此 ImageView 中的图像大部分是透明的,因此您可以看到其下面的元素

I would guess it is an ImageView that is created as the last part of your xml files (meaning it is on top of the stack/ above all other elements). And the Image in this ImageView is mostly transparent so that you see the elements below it

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文