简体   繁体   English

Android-键盘上的字符变灰吗?

[英]Android - Graying out characters on keyboard?

I want to have an EditText element accept only 0's and 1's. 我想让一个EditText元素仅接受0和1。 I have specified its 'digits' attribute to: 我已将其“数字”属性指定为:

android:digits="01"

This allows for only 0 and 1 to be entered, but I want to know if there is a way to 'grey-out' all of the keyboard buttons except for 0 and 1? 这仅允许输入0和1,但是我想知道是否有一种方法可以“灰显”除0和1以外的所有键盘按钮?

This sounds similar to your problem. 这听起来与您的问题类似。 Android - How to disable certain keys in virtual keyboard Android-如何禁用虚拟键盘中的某些键

a work around might be just to create 0 and 1 buttons in your UI? 解决方法可能只是在您的UI中创建0和1按钮?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM