我需要一个PIN码EditText
上的数字键盘。我试过使用如何在android中获取PIN码密码键盘?
android:inputType="number|textPassword"
这会调出数字键盘,但字符不是密码字符。
如何获取显示密码字符的数字键盘EditText
视图?
该应用运行于2.2及以上版本。
我需要一个PIN码EditText
上的数字键盘。我试过使用如何在android中获取PIN码密码键盘?
android:inputType="number|textPassword"
这会调出数字键盘,但字符不是密码字符。
如何获取显示密码字符的数字键盘EditText
视图?
该应用运行于2.2及以上版本。
你应该看看这里: Edittext set for password with phone number input? (android)
它指出 android:password
已被弃用,但是是唯一的出路,因为android:inputType="phone|textPassword"
被忽略......
<EditText
android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:password="true"
android:inputType="phone"
/>
这工作:
<EditText
android:id="@+id/pinEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:digits="1234567890"
android:inputType="textPassword"
android:maxLength="4" >
<requestFocus />
</EditText>
如果数字会适用于您。
编辑:啊,我明白了,它不会出现数字键盘....回到绘图板。
android:inputType =“numberPassword”用于数字键盘 –
在我styles.xml,这两个似乎为我工作:
<item name="android:inputType">numberPassword</item>
<item name="android:password">true</item>
使用: “numberSigned | numberPassword” 的
可能的复制http://stackoverflow.com/questions/2017674/ edittext-set-for-password-with-phone-number-input-android/2017791#2017791 –
@NathanVillaescusa那里接受的答案并没有帮助。这不是我的要求..我用另一个建议以编程方式设置类型的答案.. – Ronnie