[英]Edittext resizes in landscape mode when softkeyboard appears
當我在橫向模式下在屏幕上顯示EditText時,如果我點擊EditText來調出軟鍵盤,EditText會在兩個維度上展開以占據鍵盤未占用的整個屏幕! 鍵盤解除后,它將恢復正常大小。
我已經在我的手機上檢查了其他商業應用程序,其中許多(但不是全部!)也做了同樣的事情。 EditText位於TableRow中,位於TableLayout中,如下所示:
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)提前致謝!
您需要添加android:imeOptions="flagNoExtractUi"
以防止此行為。
你可以在這里閱讀更多相關信息: http : //developer.android.com/reference/android/widget/TextView.html#attr_android : imeOptions
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.