Kev*_*ood 24 android android-widget
我有以下内容:
<EditText
android:inputType="number"
android:password="true"
....
</EditText>
Run Code Online (Sandbox Code Playgroud)
我收到一条警告,"android:password"已被弃用,我应该使用inputType.有没有办法将inputType指定为数字和密码?
oca*_*nal 18
你应该使用TYPE_CLASS_NUMBER.
编辑:
作为这个答案
android:inputType="textPassword|number"
Run Code Online (Sandbox Code Playgroud)
忽略textPassword并且只接受数字但不接受密码.
所以,你应该用android:inputType="textPassword|number"用android:password="true".
这似乎是唯一的解决方案.
只需将您的输入类型设置为此android:inputType="textPassword|number"
| 归档时间: |
|
| 查看次数: |
46601 次 |
| 最近记录: |