Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edittext resizes in landscape mode when softkeyboard appears

Tags:

android

When I'm in landscape mode with an EditText on the screen, if I tap in the EditText to bring up the soft keyboard, the EditText expands in both dimensions to take up the entire screen not occupied by the keyboard! It returns to normal size when the keyboard is dismissed.

I've examined other commercial apps on my phone and many (but not all!) of them do the same thing. The EditText is in a TableRow, in a TableLayout and looks like this:

  android:id="@+id/editTextHeight"
  android:layout_width="100dp" 
  android:layout_height="wrap_content"
  android:singleLine="true"
  android:maxLength="25"
  android:hint="Height"

(Android 2.2, Droid Incredible, FWIW) Thanks in advance!

like image 963
user316117 Avatar asked Oct 25 '11 13:10

user316117


1 Answers

You need to add android:imeOptions="flagNoExtractUi" to prevent this behavior.

You can read more about it here: http://developer.android.com/reference/android/widget/TextView.html#attr_android:imeOptions

like image 136
Chase Avatar answered Oct 11 '22 03:10

Chase