InputType of EditText in Android

邮差的信 提交于 2019-12-31 02:33:07

问题


I would like to have following: - number keyboard should be displayed first - but it should be possible to change to text keyboard and to type some letters.

I've asked almost the same question and accepted an answer. InputType of EditText in Android

But now I found some strange behaviour, setting InputType to Number: it is possible to change keyboard to text type, but it's impossible to type some text.

Any Ideas, why does it happen_

Does anybody know how to use TYPE_MASK_CLASS as input type?

Thank you


回答1:


You are right and I didn't find any answer to that except if you wrote your own keyboard.
TYPE_MASK_CLASS is for masking class of EditorInfo in keyboard development.




回答2:


android:inputType="textPersonName|number|numberSigned|numberDecimal"

Paste it for Numerical Input type

android:inputType="text|textCapCharacters|textCapWords|textCapSentences|textAutoCorrect|textAutoComplete|textMultiLine|textImeMultiLine|textPersonName" Paste it for Alphabetical Input type



来源:https://stackoverflow.com/questions/5069699/inputtype-of-edittext-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!