Android EditText for password with android:hint

前端 未结 9 1109
清歌不尽
清歌不尽 2020-12-13 03:21

Just noticed that android:password has been deprecated, and we should be using android:inputType. Was experimenting with it by setting in my xml

         


        
9条回答
  •  离开以前
    2020-12-13 04:20

    If you set

    android:inputType="textPassword"
    

    this property and if you provide number as password example "1234567" it will take it as "123456/" the seventh character is not taken. Thats why instead of this approach use

    android:password="true"
    

    property which allows you to enter any type of password without any restriction.

    If you want to provide hint use

    android:hint="hint text goes here"
    

    example:

    android:hint="password"
    

提交回复
热议问题