【背景】
之前在折腾Android开发期间,在通过xml定义EditText时,出现提示:
android:phoneNumber,is deprecated: Use inputType instead
如图:
【解决过程】
1.根据提示,改为inputType后,可选项很多:
2.对于inputType来说:
“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类型含义与如何定义
转载请注明:在路上 » 【已解决】Android中代码出现警告提示:android:phoneNumber is deprecated: Use inputType instead