ImeOption = "actionNext" does not work in TextInputLayout.

I use a floating hint of material design. I want to focus from one EditText to the next, so I put imeOptions = "actionNext" in all editTexts and imeOptions = "actionDone" in the last EditText. But the focus does not switch to the next EditText. Below is a snippet of my xml.

 <android.support.design.widget.TextInputLayout
                        android:id="@+id/streetWrapper"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:theme="@style/TextInputStyle"
                        >

                        <EditText

                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:hint="Street/Locality *"
                            android:imeOptions="actionNext"
                            android:maxLines="1"

                            />

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

                    <android.support.design.widget.TextInputLayout
                        android:id="@+id/flatWrapper"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/_10sdp"
                        android:theme="@style/TextInputStyle">

                        <EditText

                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:hint="Building Name / Flat Number*"
                            android:imeOptions="actionNext"
                            android:maxLines="1"
                            />

                    </android.support.design.widget.TextInputLayout>
+5
source share
3 answers

You must add to the section . android:imeOptions="actionNext" EditText

<android.support.design.widget.TextInputLayout
                    android:id="@+id/streetWrapper"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:theme="@style/TextInputStyle"
                    >

                    <EditText
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:imeOptions="actionNext"
                        android:maxLines="1"
                        android:inputType="text"
                        />

 </android.support.design.widget.TextInputLayout>
+13
source

Add the attribute android:inputType="text"to yours EditText.

Try the following:

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

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Street/Locality *"
        android:imeOptions="actionNext"
        android:maxLines="1"
        android:inputType="text"/>

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

<android.support.design.widget.TextInputLayout
    android:id="@+id/flatWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/_10sdp">

    <EditText

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Building Name / Flat Number*"
        android:imeOptions="actionNext"
        android:maxLines="1"
        android:inputType="text"/>

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

android: inputType = "text" Tag

inputType, imeOption

:

<android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dimens_16dp">

                    <android.support.design.widget.TextInputEditText
                        android:id="@+id/et_impian"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="@string/text_fill_your_dream_here"
                        android:imeOptions="actionNext"
                        android:inputType="text"
                        android:backgroundTint="@color/color_green_manulife"/>

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

Source: https://habr.com/ru/post/1676342/


All Articles