Android:PopupWindow.showAtLocation(anchorView) ->如何获得整个屏幕作为anchorView?
我有 PopupWindow,我想将其放置在屏幕。但是,我只能访问 KeyboardView (因为我正在实现屏幕底部的 IME) 以及每当我将 < code>PopupWindow 通过使用 KeyboardView
和 Gravity.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法通过弹出窗口执行此操作。您应该使用 WindowManager 实例创建自己的窗口。
You cannot do this with a popup window. You should create your own window using a WindowManager instance.