在Edittext中设置输入电话号码时隐藏字符串
问题描述:
怎么设置Edittext属性,当输入电话号码时能隐藏字符串,
我使用android:inputType="textPassword"
来隐藏字符串,
当使用android:inputType="phone"
会出现按钮式拨号簿接口。
如何让二者结合起来?
答
android:password is deprecated, but AFAIK is the only way because android:inputType="phone|textPassword" is ignored ...
<EditText
android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:password="true"
android:inputType="phone" />
答
用 android:inputType="textPassword|phone"
可以让二者结合起来,
因为inputType可以有多个值。