zoukankan      html  css  js  c++  java
  • Editetext获取焦点后让输入软键盘中出现搜索按键

    要实现的效果如上图所示。注意在右下角出现了一个"搜索"的按钮。

    1.首先为布局文件中的Editetext控件中添加 android:imeOptions="actionSearch"  属性。

    2.在代码中监听搜索按钮。

    mSearchText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            // TODO Auto-generated method stub
            if(actionId == EditorInfo.IME_ACTION_SEARCH){
                search();
                return true;
            }
            return false;
        }
    });
  • 相关阅读:
    网站服务化
    网站服务化
    dubbo 服务化
    dubbo 服务化
    elk 搭建
    poj1840
    poj1840
    poj2299
    poj2299
    poj2388
  • 原文地址:https://www.cnblogs.com/StuLiuJun/p/4026340.html
Copyright © 2011-2022 走看看