1

我正在使用显示几个 EditTexts 的列表视图。当我单击 EditText 时,内容被正确平移,因此它不会被键盘隐藏(我在 Manifest 中使用了 android:windowSoftInputMode="adjustPan" 来做到这一点)。然而,问题是当我开始在键盘上打字时,所有的内容都会回到它的初始位置,所以它被键盘隐藏了。

这只发生在我正在测试的设备上,运行 Android 4.1.2 的 Galaxy Tab 2 10.1 并且在模拟器上没有问题。

有任何想法吗?

提前感谢,瓦伦丁

4

1 回答 1

0

只需将 ScrollView 作为 Parent 放在您的list_item_layout.xml. 喜欢:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="@string/app_name" >
</EditText></ScrollView>
于 2013-08-08T15:51:38.103 回答