Initial keyboard on lowercase

心不动则不痛 提交于 2019-12-20 04:30:39

问题


When I click on a InputText, the first letter of the keyboard begins on uppercase. As I am entering an e-mail, the ideal would always be lowercase. Is possible set this programatically?


回答1:


In your XML file, you can use android:inputType. to set the field is a email input type.

Programmatically, you can do that with setInputType()

You can specify that myEditText is an email field in your XML file :

android:inputType="textEmailAddress"

Or programmatically:

myEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);



回答2:


See TextView.setInputType and inputType.



来源:https://stackoverflow.com/questions/6430319/initial-keyboard-on-lowercase

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