我正在使用 Material 设计中的 float 提示。我想将焦点从一个 EditText
转移到下一个,所以我在所有 editTexts 和 imeOptions="actionDone
中放置了 imeOptions="actionNext"
在最后一个 EditText
中。但是焦点没有转移到下一个 EditText
。
下面是我的 xml fragment 。
<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>
最佳答案
您应该在 EditText
部分添加 android:imeOptions="actionNext"
。
<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>
关于android - imeOption ="actionNext"在 TextInputLayout 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43778628/