Android Edittext question, replace keypad enter with done

后端 未结 5 713
北恋
北恋 2020-12-10 17:30

I\'m defining an edit text like so...



        
5条回答
  •  伪装坚强ぢ
    2020-12-10 17:59

    android:imeOptions="actionNext"
    

    It replaces the name of the enter key with "Next" in the virtual keyboard and by clicking on it - focus jumps to the next field

    In your layout, you would do things like this

    
    
    

    And in Java

    TextView field2 = (TextView) field1.focusSearch(View.FOCUS_RIGHT);
    field2.requestFocus();
    

    It's up to you to decide which field will request focus next.

提交回复
热议问题