How do I specify EditText inputType as number and password?

前端 未结 3 1526
感情败类
感情败类 2020-12-10 10:16

I have the following:


I\'m getting a

相关标签:
3条回答
  • 2020-12-10 11:03

    Just set your input type to this android:inputType="textPassword|number"

    0 讨论(0)
  • 2020-12-10 11:06

    Set android:inputType="numberPassword"

    See this Link

    0 讨论(0)
  • 2020-12-10 11:09

    you should use TYPE_CLASS_NUMBER.

    EDIT:

    As this answer

    android:inputType="textPassword|number" 
    

    ignore textPassword and only accept number but not password.

    So you should use android:inputType="textPassword|number" with android:password="true".

    that seems to be the only solution.

    0 讨论(0)
提交回复
热议问题