Android 部分属性学习

android:imeOptions属性

谈一下个人的理解,设置软件盘中下一个/完成按钮的显示,如果需要监听软件盘中该按钮的事件,则需要实现 setOnEditorActionListener

其实,常用的话,就是字体显示下一个,完成或者 发送、 搜索。。。具体的值有

normal 
actionGo    
actionSearch    
actionSend    
actionDone    
actionPrevious    
flagNoFullscreen    
flagNavigatePrevious    
Corresponds 
flagNavigateNext

 

没有完呢,这样子好像还是没有效果,对的,需要加上 

android:inputType="text"
android:singleLine="true"

这样就可以了

通过下面的代码可以监听小键盘中的事件

 editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                Toast.makeText(MainActivity.this,"正在发送",Toast.LENGTH_SHORT).show();
                return true;
            }
        });

(已测)

参考文章

http://liliang1222.iteye.com/blog/1130062

http://blog.csdn.net/lastdream/article/details/24365633

 

 学习,攒经验ing

 

posted @ 2015-06-06 15:26  zzxd  阅读(230)  评论(0编辑  收藏  举报