65

I have added a LinearLayOut having some buttons My screen is RelativeLayOut it self

Here is the code for that linear layout manager

<LinearLayout
    android:orientation="horizontal"
    android:gravity="bottom"
    android:layout_alignParentBottom="true"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:id="@+id/Footer"
    android:layout_marginBottom="5dp">

Here is the problem:

There is an EditText component on the top and it pops a soft keyboard on the screen , and brings my Footer manager on top of the keyboard and eventually SHATTERS my whole UI.

What is the exact solution?

P.S. I have removed android:gravity="bottom" and android:layout_alignParentBottom="true" one by one but with hard luck i did not get desired result.

Thanks

valerybodak
  • 4,195
  • 2
  • 42
  • 53
Prasham
  • 6,646
  • 8
  • 38
  • 55
  • 1
    After some sort of digging i come to know about this line `android:windowSoftInputMode="adjustPan"` but i don't know where to add it? in menifest or in main Relative layout of the screen? – Prasham Nov 29 '10 at 06:44
  • Is that any possibility without removing, android:gravity="bottom" and android:layout_alignParentBottom="true" ? – Ashokchakravarthi Nagarajan Dec 03 '13 at 12:08

2 Answers2

169

Add android:windowSoftInputMode="adjustPan" to manifest - to the corresponding activity:

  <activity android:name="MyActivity"
    ...
    android:windowSoftInputMode="adjustPan"
    ...
  </activity>
Asahi
  • 13,378
  • 12
  • 67
  • 87
19

You probably want

<activity
     ...
   android:windowSoftInputMode="adjustNothing"> 
</activity>

That will prevent any layout changes when the soft keyboard is shown.

There is probably some confusion over this since it's currently missing from the documentation at http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

aaronvargas
  • 12,189
  • 3
  • 52
  • 52