Android overlay on top of software buttons

六月ゝ 毕业季﹏ 提交于 2019-12-07 08:55:19

问题


I am trying to write an app that draws a custom mouse pointer. I currently have a service that creates a class that extends ViewGroup and uses the WindowManager system service to display it as a TYPE_SYSTEM_OVERLAY with the FLAG_LAYOUT_IN_SCREEN set.

This almost works. On my tablet (Samsung Galaxy Tab 7.7) and in the emulator set to tablet mode, it is laid above everything except the bottom status bar (with the soft home, back keys and the notification area). In the emulator, there are no software buttons on screen, but it is laid on top of the notification bar.

I've also tried the solution in: TYPE_SYSTEM_OVERLAY in ICS but I got the same results.

Is there a way to truly draw on top of everything?


回答1:


I have previously used System Overlays to achieve something similar, and can unfortunately tell you that it isn't possible.

You can overlay on top of the entire normal screen area, and over the notification bar if it isn't clubbed with the system bar at the bottom (as is the case in some tablets). Beyond that, it seems to be impossible to overlay on top of the System Bar software buttons.



来源:https://stackoverflow.com/questions/14283575/android-overlay-on-top-of-software-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!