UE提出想改輸入鍵盤(pán)輸入法右下角的enter button的文字凛澎,但是經(jīng)過(guò)一番探索發(fā)現(xiàn)自定義幾乎是不可能的汁蝶。
我們只能通過(guò)設(shè)定TextView 的 android:imeOptions ,在幾個(gè)行為模式間切換
- actionGo(開(kāi)始)
- actionSearch(搜索)
- actionSend(發(fā)送)
- actionNext(下一個(gè))
- actionDone(完成)
- actionPrevious(前一個(gè))
不同的輸入法會(huì)用不同的方式實(shí)現(xiàn)以上行為系馆,比如伐庭,有的actionSearch會(huì)是“搜索”文字,有的會(huì)是一個(gè)放大鏡圖標(biāo)漏策,有的actionDone會(huì)是“完成”文字,有的會(huì)是一個(gè)回車(chē)圖標(biāo)臼氨。
android:imeActionLabel 這個(gè)不是用來(lái)給我們自定義右下角這個(gè)enter button的文字用的掺喻,用它設(shè)置的文字的用途是:
The full label is only displayed when the IME has a large amount of space for it (such as when the standard keyboard is in fullscreen mode).
Google+ Android論壇的這篇討論中解釋得很好
綜上,我們只需要定義這個(gè)enter button的行為储矩,而不是它顯示的文字感耙。