EditText 一些常用操作 如监听任荣变化,改变键盘上的字 等等

改变键盘上的回车变为搜索按钮

有的事一个放大镜有的会显示成搜索两个字
etSearch.setImeOptions(EditorInfo.IME_ACTION_SEARCH);//设置搜索属性
//监听按下的操作
etSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId==EditorInfo.IME_ACTION_SEARCH){
if (TextUtils.isEmpty(v.getText().toString())){
UITipDialog.showFall(ExhibitionCenterActivity.this,”请输入要搜索内容”);
return true;
}
mRefreshHelper.onDefaluteMRefresh(true);
}
return true;
}
});

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章