10

firstname と lastnameという 2 つのTextInputLayout要素が並んでいます。それらの下には、もう 1 つの全角TextInputLayout要素があります。それは、email です。

キーボードの次のボタンを上書きして、名の入力内で[次へ]をクリックすると、姓の入力に移動し、そこから電子メールなどに移動するようにしようとしています.

ここでの問題は、キーボードで [次へ] を押すと、姓のフィールドではなく、その下の電子メールに移動することです。

これは、次の 3 つの入力がある xml ファイルの一部です。

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="center_horizontal"
    android:baselineAligned="false">

    <android.support.design.widget.TextInputLayout
        android:id="@+id/input_layout_firstname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1">

        <EditText
            android:id="@+id/register_input_firstname"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/hint_firstname"
            android:inputType="textCapSentences"
            android:nextFocusForward="@+id/register_input_lastname"
            android:nextFocusRight="@+id/register_input_lastname" />

    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:id="@+id/input_layout_lastname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1">

        <EditText
            android:id="@+id/register_input_lastname"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/hint_lastname"
            android:inputType="textCapSentences"
            android:nextFocusDown="@+id/register_input_email" />

    </android.support.design.widget.TextInputLayout>

</LinearLayout>

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout_email"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/register_input_email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/hint_email"
        android:inputType="textEmailAddress" />

</android.support.design.widget.TextInputLayout>

TextInputLayout代わりに もターゲットにしようとしましたEditTextが、効果がありません。

次のフォーカスはTextInputLayout's でさえ可能ですか、それともバグですか、それとも私は何か非常に間違っていますか?

4

4 に答える 4

12

これに変更 --> android:nextFocusDown="@+id/register_input_lastname"

于 2016-01-29T08:33:51.383 に答える