How not to distort the layout when opening the keyboard?

5

I have a linear layout with a form. whenever the keyboard is open it distorts my layout by leaving my buttons in half, is there any way to keep my layout intact when the keyboard is open ?? Any command that locks my layout behind the keyboard ??

    
asked by anonymous 26.07.2016 / 15:39

3 answers

4

Speak Edu,

Try to put this line inside your onCreate method:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

This will make the layout fit without distortion when you open the keyboard.

Hugs.

    
26.07.2016 / 15:50
1

The option you are looking for is adjustPan . In the Manifest, put in the entry corresponding to your Activity:

<activity
    ...
    android:windowSoftInputMode="adjustPan"
    ...
>
</activity>
    
26.07.2016 / 15:53
1

I use this for the layout if I adjust it with the keyboard open, maybe I can help you!

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    
26.07.2016 / 15:55