开发者

Where is "go" button in EditText

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜