1.android:imeOptions 可以用来配置输入法右下角的:

这可以在xml中添加相应的属性android:imeOptions

actionGo 输入法右下角显示“去往”

actionSearch 输入法右下角显示“搜索”

actionSend 输入法右下角显示“发送”

actionNext 输入法右下角显示“下一个”

actionDone 输入法右下角显示“完成”

actionPrevious输入法右下角显示“上一个”.

必须要设置android:inputType="text" 后面的才能生效.

2.监听右下角按键:

    private OnEditorActionListener actionListener = new OnEditorActionListener() {                @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            switch (v.getId()) {                case R.id.first:                    if(actionId == EditorInfo.IME_ACTION_SEND) {                    }                    break;                case R.id.second:                                        break;                default:                    break;            }            return false;        }    };

actionUnspecified 未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED.
actionNone 没有动作,对应常量EditorInfo.IME_ACTION_NONE
actionGo 去往,对应常量EditorInfo.IME_ACTION_GO
actionSearch 搜索,对应常量EditorInfo.IME_ACTION_SEARCH
actionSend 发送,对应常量EditorInfo.IME_ACTION_SEND
actionNext 下一个,对应常量EditorInfo.IME_ACTION_NEXT
actionDone 完成,对应常量EditorInfo.IME_ACTION_DONE

如此就可以自定义右下角按键的行为。

更多相关文章

  1. Android(安卓)登录界面调用输入法时让界面自动上移,使输入法不会
  2. Android中点击按钮后隐藏输入法
  3. android editText 软键盘enter键图标的设置
  4. Android(安卓)软键盘问题总结
  5. Android(安卓)Lib Project与Android(安卓)Project中R文件的区别
  6. Android日常应用记录
  7. Android日语输入法Simeji使用示例
  8. Android(安卓)WifiManager 常量
  9. Android(安卓)dialog 强制弹出输入法

随机推荐

  1. 如何使用pip安装Python MySQLdb模块?
  2. 检测Python程序的执行效率
  3. python自然语言处理——3.8 分割
  4. 转:图解 Python 深拷贝和浅拷贝
  5. Python3语法——Python3函数参数的各种形
  6. Spark RDD Python 学习笔记一
  7. 具有相同时区但不同的utcoffset()的Datetim
  8. 从子线程终止主线程
  9. Django -表单无效但没有错误
  10. 机器学习算法之七:5分钟上手SVM