NextFocusDown无法与AutoCompleteTextView一起使用

34

我试图在用户填写一个文本后集中精力进行下一个编辑文本。该代码对于EditText完全正常,但当我将其应用于AutoCompleteTextView时,键盘中的下一个按钮不起作用。光标停留在原地。 这是我正在使用的代码:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="11" >

    <AutoCompleteTextView
        android:id="@+id/etLN"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:ems="10"
        android:nextFocusDown="@+id/etC"
        android:inputType="textPersonName" >

        <requestFocus />
    </AutoCompleteTextView>

    <EditText
        android:id="@id/etC"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="4"
        android:ems="10"
        android:hint="0.0"
        android:nextFocusDown="@+id/etD"
        android:inputType="numberDecimal"
        android:text="" />

    <EditText
        android:id="@id/etD"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="4"
        android:ems="10"
        android:nextFocusDown="@+id/etLN2"
        android:hint="0.0"
        android:inputType="numberDecimal"
        android:text="" />
</LinearLayout>

请告诉我如何正确地做这件事。 谢谢 :)

1个回答

104

将此添加到您的AutoCompleteTextView中

android:imeOptions="actionNext"

它应该可以运行。


1
如果我可以的话,我会给你一份赏金..虽然我没有(声望)...但是...非常感谢@techieWings - chaitanyad
1
我花了5天时间才解决这个问题。非常感谢。 - Chrishan
非常感谢。节省了我很多时间。 - Methnani Bilel
不错!谷歌现在应该已经修复了。 - Someone Somewhere

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接