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 ??
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 ??
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.
The option you are looking for is adjustPan . In the Manifest, put in the entry corresponding to your Activity:
<activity
...
android:windowSoftInputMode="adjustPan"
...
>
</activity>
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);