输入不工作的数字输入框的按键事件? [英] Enter key event not working on Numeric Input field?
问题描述
我创建了两个EditText上与这两个属性。
I created two EditText with these two property.
android:digits="0123456789"
android:inputType="numberDecimal"
我用硬件键盘,当我执行回车键,对焦控制不能从一个视图下一个视图转移,因为它发生在案件的EditText正常。如果我删除。的android:数字属性,那么它正常工作,但在这里它允许插入小数点键也,我不希望
I use Hardware Keyboard, when I perform Enter Key, focus control not shifting from one view to next view, as it happen normal in EditText case. If I remove "android:digits" property then it work properly, but here it allow to insert decimal key also, that I don't want.
我试着用的android:nextFocusDown 。proerty也行,不过这也不是在这种情况下工作。
I tried with "android:nextFocusDown" proerty also, but that is also not working in this case.
任何一个有想法如何使用回车键事件转移焦点。
Any one have idea how can use Enter key event to shift focus.
推荐答案
使用
为
android:inputType="number"
或
android:digits="0123456789"
PS:
最好的是的android:inputType下=号
,因为它会自动打开数字键盘
best one is android:inputType="number"
because it will automatically open the numeric keyboard
在这里为安卓位数=0123456789
这将打开简单的键盘
这篇关于输入不工作的数字输入框的按键事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!