Setting EditText imeOptions to actionNext has no effect

前端 未结 12 873
终归单人心
终归单人心 2020-12-13 11:46

I have a fairly complex (not really) xml layout file. One of the views is a LinearLayout (v1) with two children: an EditText(v2) and another Linear

相关标签:
12条回答
  • 2020-12-13 12:09

    Finally i have got sure solution for this issue Just add these 3 lines in your edit text and it will be working fine

            android:maxLines="1"
            android:inputType="text"
            android:imeOptions="actionDone"
    

    Here you can add maxLines according to your requirement. Do not use singleLine as it is deprecated now. Good luck!

    0 讨论(0)
  • 2020-12-13 12:13

    Just add android:maxLines="1" & android:inputType="text" to your EditText. It will work!! :)

    0 讨论(0)
  • 2020-12-13 12:13

    android:singleLine has been deprecated, it is better to combine android:maxLines="1" with android:inputType="text". This would be the code:

    <EditText
            android:id="@+id/editText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:maxLines="1"
            android:inputType="text"
            />
    
    0 讨论(0)
  • 2020-12-13 12:14

    Key here is to set input type and imeOptions attributes

    <EditText 
       android:inputType="number"
       android:maxLines="1"
       android:imeOptions="actionSearch" />
    
    0 讨论(0)
  • 2020-12-13 12:15

    Only this worked for me.

    Change it:

    android:maxLines="1"
    android:inputType="text"
    android:imeOptions="actionNext"
    

    on that:

    android:singleLine="true"
    android:inputType="text"
    android:imeOptions="actionNext"
    
    0 讨论(0)
  • 2020-12-13 12:20
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/auth_register_re_password"
        android:hint="Enter Password Again"
        android:imeActionLabel="login"
        android:gravity="center"
        android:imeOptions="actionUnspecified"
        android:inputType="textPassword"
        android:maxLines="1"/>
    
    0 讨论(0)
提交回复
热议问题