【问题标题】:NextFocusDown doesn't work with AutoCompleteTextViewNextFocusDown 不适用于 AutoCompleteTextView
【发布时间】:2013-01-05 13:15:52
【问题描述】:

我正试图在用户填写后专注于下一个编辑文本。代码在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>

请告诉我这样做的正确方法是什么。 谢谢:)

【问题讨论】:

    标签: android autocomplete android-edittext android-xml


    【解决方案1】:

    将此添加到您的 AutoCompleteTextView

    android:imeOptions="actionNext"
    

    它应该可以工作。

    【讨论】:

    • 如果可以的话,我会给你一个赏金......不是我有任何(声誉)......仍然......非常感谢@techieWings
    • 我花了 5 天时间都没有弄清楚这一点。谢谢堆。
    • 非常感谢。节省了我很多时间。
    • 不错的一个!谷歌现在应该已经修复了它
    猜你喜欢
    • 2015-04-02
    • 2016-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-22
    • 2018-08-12
    • 1970-01-01
    相关资源
    最近更新 更多