如何指定的EditText inputType的号码和密码? [英] How do I specify EditText inputType as number and password?

查看:145
本文介绍了如何指定的EditText inputType的号码和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下几点:

<EditText
    android:inputType="number"
    android:password="true"
    ....
</EditText>

我收到一个警告,安卓密码是德precated,我应该用inputType代替。有没有一种方法来指定inputType的号码和密码?

I'm getting a warning that "android:password" is deprecated and that I should use inputType instead. Is there a way to specify inputType as number and password?

推荐答案

设置机器人:inputType =numberPassword

Set android:inputType="numberPassword"

链接:<一href="http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType">http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType

这篇关于如何指定的EditText inputType的号码和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆