我本质上是尝试以编程方式设置EditText的数字值.到目前为止,我有:
weightInput.setInputType(InputType.TYPE_CLASS_PHONE); weightInput.setKeyListener(DigitsKeyListener.getInstance());
这很好,但我也希望能够包含小数位(.).有任何想法吗?
android android-edittext
android ×1
android-edittext ×1