EDITTEXT调整大小在横向模式下显示softkeyboard时

问题描述:

当我在横向模式下在屏幕上一个EditText,如果我点击了的EditText,弹出软键盘,在扩大的EditText在两个方面采取了不被键盘占据了整个屏幕!它返回时,键盘被驳回正常大小。

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.

我已经检查了我的手机和许多(但不是全部!)其他商业应用程序他们做同样的事情。该EditText上是通过tablerow,在TableLayout,看起来是这样的:

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难以置信,FWIW)在此先感谢!

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

您需要添加安卓imeOptions =flagNoExtractUi来prevent此行为。

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

您可以阅读更多关于它在这里:http://developer.android.com/reference/android/widget/TextView.html#attr_android:imeOptions

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