EDITTEXT调整大小在横向模式下显示softkeyboard时 [英] Edittext resizes in landscape mode when softkeyboard appears

查看:197
本文介绍了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.

您可以阅读更多关于它在这里:<一href="http://developer.android.com/reference/android/widget/TextView.html#attr_android:imeOptions">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

这篇关于EDITTEXT调整大小在横向模式下显示softkeyboard时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆