0

我有一个包含 20 行的 ListView 控件,每行包含 EditText。在我的例子中,当键盘打开时,前 7 行是可见的。考虑我选择了从 8 到 20 的任何行中的任何 EditText,所选行将位于键盘上方。Then I tries to type on keyboard, the ListView moves to top and the row containing the EditText in which I was editing should be hidden by the keyboard.

Actually I want the row should be in same position just above the keyboard even while typing on keyboard.

Screen1 : Screen seems like this when opened

Screen2 : When row #9 is selected, seems fine as the selected row came just above the keyboard

Screen3 : While typing on keyboard, screen seems like this as the list scrolls to top

Screen4 : On hiding the keyboard, screen seems like this with entered text

打开后屏幕是这样的

When row #9 is selected, seems fine as the selected row came just above the keyboard

在键盘上键入时,当列表滚动到顶部时,屏幕看起来像这样

隐藏键盘时,输入文本的屏幕看起来像这样

请告诉我解决方案..请

4

2 回答 2

0

我希望这能帮到您。manifest.xml在您的特定活动中添加此代码。

android:windowSoftInputMode="adjustPan"
于 2013-09-13T10:58:34.923 回答
0

将以下行添加到 manifest.xml 中的活动

android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
于 2013-09-13T11:01:16.053 回答