我有一个安卓EditText
,我想让数字键盘出现。
如果我将android:inputType设置为numberSigned,我将获得数字键盘和键入负片的功能。但是,这不会让我使用小数。如果我使用numberDecimal inputType,我可以使用小数,但不能使用负数。
怎样才能得到能够输入小数和负数的数字键盘呢?
发布于 2011-09-25 13:41:14
你只是在你的EditText中遗漏了这个,
android:inputType="numberDecimal|numberSigned"
发布于 2014-11-26 19:41:06
我们可以使用,
edit_text.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
如果我们需要以编程方式使用..
发布于 2011-09-25 14:53:28
查看此链接可能是it's help you http://developer.android.com/resources/articles/creating-input-method.html
android:inputtype的可能值为:
•none
•text
•textCapCharacters
•textCapWords
•textCapSentences
•textAutoCorrect
•textAutoComplete
•textMultiLine
•textImeMultiLine
•textNoSuggestions
•textUri
•textEmailAddress
•textEmailSubject
•textShortMessage
•textLongMessage
•textPersonName
•textPostalAddress
•textPassword
•textVisiblePassword
•textWebEditText
•textFilter
•textPhonetic
•textWebEmailAddress
•textWebPassword
•number
•numberSigned
•numberDecimal
•numberPassword
•phone
•datetime
•date
•time
https://stackoverflow.com/questions/7543835
复制相似问题