Android:屏幕上浮动可点击图标?
有一个名为智能任务栏
的Android应用程序,它设法在屏幕上固定一个半透明的小图标...该图标在所有活动(包括主屏幕)上保持可见。该图标是可点击的(/可触摸的),并且它会弹出一个用户可以与之交互的小弹出窗口。
我非常感兴趣这是如何做到的?我认为这与 PopupWindow
有关。
有什么想法吗?提前致谢。
There's an Android Application called Smart Taskbar
that manages to Pin a small SemiTransparent Icon over the screen...The icon remains visible over ALL the activites (including the home screen). The Icon is Clickable (/Touchable), and it does popopen a Small Popup window which the user can interact with.
I'm very interested in how this is done? I think it's something to with PopupWindow
.
Any ideas? Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近对此进行了实验。
请参阅此问题:创建系统覆盖窗口(始终打开) top) - 解决方案实际上是相同的,但您需要在布局参数中设置
TYPE_SYSTEM_ALERT
而不是TYPE_SYSTEM_OVERLAY
。I recently experimented with this.
See this question: Creating a system overlay window (always on top) - the solution is virtually the same, but you need to set
TYPE_SYSTEM_ALERT
in the layout params instead ofTYPE_SYSTEM_OVERLAY
.