最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

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

Android crifan 6229浏览 0评论

【背景】

之前在折腾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类型含义与如何定义

转载请注明:在路上 » 【已解决】Android中代码出现警告提示:android:phoneNumber is deprecated: Use inputType instead

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.201 seconds, using 22.15MB memory