Android设置软键盘右下角为搜索
生活随笔
收集整理的這篇文章主要介紹了
Android设置软键盘右下角为搜索
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
需要注意的是,修改軟鍵盤為搜索或者其他時,需要設(shè)置
android:singleLine="true"否則無效
要設(shè)置軟鍵盤為搜索的EditText布局文件中
android:imeOptions="actionSearch"或者在代碼中為要軟鍵盤為搜索的EditText設(shè)置
searchEditText.setImeOptions(EditorInfo.IME_ACTION_SEARCH);軟鍵盤搜索事件
searchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {@Overridepublic boolean onEditorAction(TextView v, int actionId, KeyEvent event) {if(actionId==EditorInfo.IME_ACTION_SEARCH){//執(zhí)行搜索操作//TODO..return true;}return false;}});其余常用imeOptions
右下角變?yōu)橥瓿?/p> android:imeOptions="actionDone"
右下角變?yōu)榘l(fā)送
android:imeOptions="actionSend"右下角變?yōu)榍巴?/p> android:imeOptions="actionGo"
右下角變?yōu)橄乱豁?/p> android:imeOptions="actionNext"
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的Android设置软键盘右下角为搜索的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: getservbyname、getser
- 下一篇: C++ 圆的面积