【已解决】Android中代码出现警告提示:android:phoneNumber is deprecated: Use inputType instead

【背景】

之前在折腾Android开发期间,在通过xml定义EditText时,出现提示:

android:phoneNumber,is deprecated: Use inputType instead

如图:

android phoneNumber is deprecated Use inputType instead

 

【解决过程】

1.根据提示,改为inputType后,可选项很多:

for edittext inputtype so many choice

2.对于inputType来说:

TextView | Android Developers

“android:inputType

The type of data being placed in a text field, used to help an input method decide how to let the user enter text. The constants here correspond to those defined by InputType. Generally you can select a single value, though some can be combined together as indicated. Setting this attribute to anything besides none also implies that the text is editable.

Must be one or more (separated by ‘|’) of the following constant values.

对应的类是:

InputType | Android Developers

 

【总结】

后来,就去整理了相应的内容:

【整理】Android中EditText中的InputType类型含义与如何定义



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量