android - imeOption ="actionNext"在 TextInputLayout 中不起作用

标签 android xml android-layout android-textinputlayout

我正在使用 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/

相关文章:

安卓 Intent 问题

android - 哪些工具和技术用于将视频从Youtube App转换到Smart TV?

c# - 在构建过程中生成一个 Xml 序列化程序集

android - 将自定义 View 放入另一个 View ,同时使用 XML 布局

android - Espresso 在 RecyclerView 中发现可能不在屏幕上的行

Android: gradle exclude commons-codec

c# - 如何使用自定义 IXmlSerializable 作为 XmlAttribute?

XMLParse( ) 抛出 Content is not allowed in prolog 错误

android - 在 Android 的仪表板中需要帮助

android - LinearLayout 中的 ImageView