Android 监听软键盘按键与改变软键盘右下角按键样式
来源:互联网 发布:淘宝买家秀对比 编辑:程序博客网 时间:2024/04/28 22:15
android:singleline=”true”
android:imeoptions=”actionSearch”
一定要加singleline=”true”!!!
actionNone : 回车键,按下后光标到下一行
actionGo : Go,
actionSearch : 放大镜
actionSend : Send
actionNext : Next
actionDone : Done,确定/完成,隐藏软键盘,即使不是最后一个文本输入框
xml
<EditText android:imeOptions="actionSend" android:id="@+id/et_input_message" android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginRight="15dp" android:background="#ffffff" android:layout_weight="1" android:singleLine="true" />
java
et_input_message.setOnEditorActionListener(new EditText.OnEditorActionListener(){ @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { LogUtil.d("zza",actionId+"=="); switch (actionId) { case EditorInfo.IME_ACTION_NONE: Toast.makeText(getApplicationContext(), "点击NONE", Toast.LENGTH_SHORT).show(); break; case EditorInfo.IME_ACTION_GO: Toast.makeText(getApplicationContext(), "点击GO", Toast.LENGTH_SHORT).show(); break; case EditorInfo.IME_ACTION_SEARCH: Toast.makeText(getApplicationContext(), "点击SEARCH", Toast.LENGTH_SHORT).show(); break; case EditorInfo.IME_ACTION_SEND: Toast.makeText(getApplicationContext(), "点击SEND", Toast.LENGTH_SHORT).show(); break; case EditorInfo.IME_ACTION_NEXT: Toast.makeText(getApplicationContext(), "点击NEXT", Toast.LENGTH_SHORT).show(); break; default: break; } return false; } });
0 1
- Android 监听软键盘按键与改变软键盘右下角按键样式
- Android App监听软键盘按键的三种方式与改变软键盘右下角确定键样式
- Android 改变软键盘右下角样式
- Android 更改软键盘右下角按键的样式以及监听此键的方法
- Android 监听软键盘按键
- Android软键盘之代码改变软键盘状态
- android:imeOptions 控制软键盘右下角按键
- android软键盘右下角按键设置
- android 键盘按键监听
- android 键盘按键监听
- android 监听软键盘按键的三种方式--和--隐藏系统键盘
- 监听手机软键盘按键
- 手机软键盘按键监听
- Android App监听软键盘按键的三种方式
- Android App监听软键盘按键的三种方式
- Android App监听软键盘按键的三种方式
- Android App监听软键盘按键的三种方式
- Android App三种监听软键盘按键
- 【备忘】麦可网-Cocos2D-X跨平台游戏开发 完整4G下载
- SVN服务器搭建--Subversio与TortoiseSVN的配置安装
- node.js中的path.resolve方法使用说明
- 魅族Flyme获取Root权限
- TypeScript学习笔记之 类
- Android 监听软键盘按键与改变软键盘右下角按键样式
- Mac Android Studio 2.2.3 Gradle配置
- 抽象的理解
- opencv3.1.0 交叉编译 H3516a
- Android 应用程序执行Shell命令
- window.onload 、$(function())、;(function(){}()); 的执行顺序
- 编译错误"/usr/bin/ld: cannot find -lz"
- [python学习]利用generator实现杨辉三角
- iOS UIView动画