Search code examples
javaandroidandroid-layoutandroid-gui

Stop GUI squishing up when keyboard appears?


I just want my GUI elements to stay where they are.

Instead, whenever the keyboard comes up, they push half the labels and buttons up.

I'm using relative layout if it helps.

I've tried adding things like:

    android:windowSoftInputMode="adjustPan"

to the manifest.xml but it hasn't done anything.

Ideas??


Solution

  • This is how I solved it.

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

    in the onCreate() method.