安卓的EditText中的ListViewEditText、ListView

2023-09-12 09:50:59 作者:꧁༼『遇见』༽+

我想有一个定制的ListView,其中每一行包含一个EditText字段,可以由用户编辑。但是,当我点击我失去焦点的EditTexts之一,不能输入文字那里(我想,因为其他行的重画,并获得焦点)。 我该怎么办?

I would like to have a custom ListView, where each row contains an EditText field, that may be edited by the user. But when I click on one of the EditTexts I lose the focus, and can't type text there (I suppose because the other rows are redrawn and get the focus). What can I do?

推荐答案

如果问题涉及到的软件键盘,试图在AndroidManifest.xml中设置windowSoftInputMode为adjustPan在活动的声明如下:

If the problem is related to software keyboard, try to set windowSoftInputMode to adjustPan in activity declaration in AndroidManifest.xml as follows:

  ...
    <activity 
        android:name=".activity.Activity"
        android:label="@string/activity"
        android:windowSoftInputMode="adjustPan" />
    ...

这应该帮助。检查http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html关于它的更多信息。

It should help. Check http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html for more info about it.