問(wèn)題描述
如何禁用 Android 虛擬鍵盤(pán)中的某些鍵(比如數(shù)字/符號(hào)鍵)?
How to disable certain keys (say number/symbol keys) in Android virtual keyboard?
具體來(lái)說(shuō),當(dāng)用戶關(guān)注標(biāo)準(zhǔn)的 android EditText 小部件時(shí),當(dāng)虛擬鍵盤(pán)出現(xiàn)時(shí),我希望用戶不能輸入雙引號(hào) ( " ) 字符.
Specifically I want user can't input a double quote ( " ) character when virtual keyboard is showed up when user focus on a standard android EditText widget.
推薦答案
如何禁用 Android 虛擬鍵盤(pán)中的某些鍵(比如數(shù)字/符號(hào)鍵)?
How to disable certain keys (say number/symbol keys) in Android virtual keyboard?
你不能,對(duì)不起.畢竟輸入法編輯器可能一開(kāi)始就沒(méi)有按鍵".
You can't, sorry. After all, the input method editor may not have "keys" in the first place.
具體來(lái)說(shuō),當(dāng)用戶關(guān)注標(biāo)準(zhǔn)的 android EditText 小部件時(shí),當(dāng)虛擬鍵盤(pán)出現(xiàn)時(shí),我希望用戶不能輸入雙引號(hào) ( " ) 字符.
Specifically I want user can't input a double quote ( " ) character when virtual keyboard is showed up when user focus on a standard android EditText widget.
然后您將不得不通過(guò) InputFilter
來(lái)阻止 EditText
的輸入,如下所述:如何在 Android 中使用 InputFilter 限制 EditText 中的字符?一個(gè)>
Then you will have to block the input at the EditText
, by means of an InputFilter
, as is described here: How do I use InputFilter to limit characters in an EditText in Android?
這篇關(guān)于Android - 如何禁用虛擬鍵盤(pán)中的某些鍵的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!