How to programmatically hide/disable emoticons on Android soft keyboard

后端 未结 6 694
暗喜
暗喜 2020-12-03 01:25

Is it possible to hide a specific keyboard button? I have an EditText and on some devices its keyboard has smiley faces while on other devices it is missing. I

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 01:31

    (For completeness sake)

    This solution is for people who need to have textview without the smiley on their soft keyboard. @Adrian's solution, to use email address type, works but it will show unnecessary '@' and '.com' buttons on your keyboard. I tried several combinations of InputType and the best solution IMHO is this:

    mTextView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    

    Original Keyboard:

    Resulting keyboard:

提交回复
热议问题