开发者

android EditText inputType for StreetNumber field

开发者 https://www.devze.com 2023-03-23 11:51 出处:网络
I\'m trying to choose correct inputType in my adress dialogstreetNumber field. I want to show numeric keyboard first, but then let user also to input开发者_如何学Python alphabetic characters

I'm trying to choose correct inputType in my adress dialog streetNumber field. I want to show numeric keyboard first, but then let user also to input开发者_如何学Python alphabetic characters for some very special cases. Closer to this is inputType datetime, but this doesn't allow to enter alphabetic characters. So how to set my streetNumber field correctly?


Use android:inputType="textPostalAddress"


The EditText inherits from TextView and shares its input type attributes with it. They can be found here in the official documentation.

Maybe the input type textPostalAddress would be suitable for your need. If not, plenty of other types are available. The XML attribute that allows setting this type is android:inputType="the type you have chosen".


See if this can help you

myEditText.setRawInputType(Configuration.KEYBOARD_QWERTY)
0

精彩评论

暂无评论...
验证码 换一张
取 消