[英]Hidden EditText when soft keyboard appears
当出现软键盘供用户输入输入并覆盖应出现文本的EditText时,我遇到了一个典型的问题。
我尝试了许多不同的“修复”和解决方案,但均未成功。 我猜我的布局中有某种组合会导致此问题。
现在在AndroidManifest.xml中,我有这行
<activity
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustPan">
EditText的布局如下,底部是EditText。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:fillViewport="true"
android:scrollbars = "vertical"
android:windowSoftInputMode="adjustPan|adjustResize">
<LinearLayout
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/cargoRoot"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:numColumns="auto_fit"
android:stretchMode="columnWidth" >
<LinearLayout
android:layout_height="wrap_content" android:layout_width="600dp"
android:orientation="vertical" >
<TextView style="@style/smalltext" />
<TextView
android:id="@+id/arrivalEta"
android:layout_height="wrap_content" android:layout_width="wrap_content" />
<TextView
android:text="@string/cargoComments"
style="@style/smalltext" />
<ScrollView android:id="@+id/scrollEditCargoComments"
android:layout_width="fill_parent" android:layout_height="142dp"
android:scrollbars="vertical">
<EditText
android:id="@+id/editCargoComments"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="@dimen/text_normal"
android:minLines="5"
android:imeOptions="actionDone"
android:imeActionLabel="@string/send"
android:inputType="textNoSuggestions" />
</ScrollView>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
其他值得评论的是,我的EditText的可见性消失了,直到应用程序中提示用户输入评论的某些点为止。 然后,我将可见性更改为“可见”,并且当用户点击文本时,出现软键盘。 似乎隐藏了所有内容。 没有调整大小或平移操作。
包含EditText的视图位于代码后面,并插入到PopupWindow内的另一个视图中。
所以就像MainActivity> PopupWindow> ViewFlipper> EditText
我想知道PopupWindow或ViewFlipper是否会给软键盘管理添加一些毒药。
提前致谢
尝试这个:
android:windowSoftInputMode =“ adjustResize | adjustPan | stateHidden”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.