Android: PopupWindow.showAtLocation(anchorView) -> how to get the whole screen as a anchorView?
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?
You cannot do this with a popup window. You should create your own window using a WindowManager instance.
精彩评论