我创建了一个具有相当复杂子项xml的ExpandableListView。它包含一个TextView,一个Checkbox和一个EditText。以下是其中的一部分:
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:stretchColumns="1">
<TableRow>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="@+id/lblData1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dip"
android:paddingTop="2dp"
android:layout_marginLeft="4dp"
android:text="@string/lblTitle1"
android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft"/>
<EditText android:layout_width="wrap_content"
android:layout_height="wrap_content" android:selectAllOnFocus="true">
</EditText>
</TableRow>
</TableLayout>
- 列表视图很好地显示了列表,我可以看到我的子项及其对应的小部件,但当我点击EditText时,它会瞬间显示键盘并且焦点转移到下一个子项并隐藏键盘(焦点丢失,不是移动到下一个EditText)。
- 我该如何防止这种情况发生?我想在EditText中输入文本。