android键盘移动光标,在Android键盘上完成键
José Silva..
12
代替
ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
嘗試
ic.performEditorAction(EditorInfo.IME_ACTION_GO);
執(zhí)行的操作應(yīng)該是在EditorInfo上定義的操作,它將在方法onStartInputView上傳遞給您
要在操作之間切換,請使用:
(sEditorInfo.imeOptions & (EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION))
希望這可以幫助.
碼:
case -1:
switch (sEditorInfo.imeOptions & (EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
case EditorInfo.IME_ACTION_GO:
ic.performEditorAction(EditorInfo.IME_ACTION_GO);
break;
case EditorInfo.IME_ACTION_NEXT:
ic.performEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
case EditorInfo.IME_ACTION_SEARCH:
ic.performEditorAction(EditorInfo.IME_ACTION_SEARCH);
break;
case EditorInfo.IME_ACTION_SEND:
ic.performEditorAction(EditorInfo.IME_ACTION_SEND);
break;
default:
ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
break;
}
break;
總結(jié)
以上是生活随笔為你收集整理的android键盘移动光标,在Android键盘上完成键的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 股票停盘啥意思
- 下一篇: 股票pb和pe怎么看