The dialog rises when the on-screen keyboard is displayed.

I have a class that extends to Dialog. In this dialog, I have EditText and ListView. I manage to bring softkeyboard when this dialog box is shown. But my problem is, can we make the dialog not rising when the on-screen keyboard is displayed? I tried changing the softInputMode in the layout parameter to adjust the size, but it does not work. My dialog using the x and y positions, when the on-screen bar and up dialog are displayed, my dialog is not in the right position.

+4
source share
2 answers

Try to do this:

dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 
+10
source

If you want to resize it and not just move it, use:

 dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); 

It will also allow you to scroll in the dialog box.

+7
source

Source: https://habr.com/ru/post/1388013/


All Articles