Android:PopupWindow.showAtLocation(anchorView) ->如何获得整个屏幕作为anchorView?

发布于 2024-09-26 16:56:36 字数 545 浏览 2 评论 0原文

我有 PopupWindow,我想将其放置在屏幕。但是,我只能访问 KeyboardView (因为我正在实现屏幕底部的 IME) 以及每当我将 < code>PopupWindow 通过使用 KeyboardViewGravity.CENTER 它当然只在键盘上方居中,而不是在整个屏幕中。

有没有办法让整个屏幕作为锚视图?

I have PopupWindow, which I'd like to place in the center of the screen. However, I only have access to the KeyboardView (since I'm implementing an IME) at the bottom of the screen and whenever I center my PopupWindow by using the KeyboardView and Gravity.CENTER it is of course only centered above the keyboard, but not in the whole screen.

Is there a way to get the whole screen as an anchor view?

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

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

发布评论

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

评论(1

呆橘 2024-10-03 16:56:36

您无法通过弹出窗口执行此操作。您应该使用 WindowManager 实例创建自己的窗口。

You cannot do this with a popup window. You should create your own window using a WindowManager instance.

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