最新消息:服务器现已从linode换到fzhost.net,且主题已从retina 0.2换为大前端D8

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

Android crifan 14浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
51 queries in 0.540 seconds, using 12.54MB memory