开发者

Where is "go" button in EditText

开发者 https://www.devze.com 2023-03-18 06:48 出处:网络
I have an editText and it shows a newline button instead of a go button. Why? android:minLines=\"40\" Also, I\'m showing the virtual keyboard using:

I have an editText and it shows a newline button instead of a go button. Why?

android:minLines="40"

Also, I'm showing the virtual keyboard using:

InputMethodManager imm = (InputMethodManager) TrackActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
开发者_C百科if (imm != null){
  imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
}


If you want a "Go" button, try this as your edittext element:

  <EditText
    android:text="EditText"
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:imeOptions="actionGo" />

In other words set imeOptions to "actionGo".


You will have to specify what kind of an action keyboard you need. For your particular case, you will need to specify that you want a Go button.

http://developer.android.com/reference/android/widge/TextView.html#attr_android:imeActionLabel

android:imeActionLabel="actionGo"


android:imeOptions="actionGo"

Simple

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号