问题在标题中。
我在我的文本字段中显示一个 int 数字,但是当我退出该字段时它不断添加一个“,”......任何想法为什么?
对于代码爱好者:
onfocuslost 调用:
if(textStiffness != null){
String s1 = textStiffness.getText();
if(s1 != null){
stiffness = Float.valueOf(s1.replaceAll(",", "")).intValue();
stiffness = Math.max(0, stiffness);
}
}
然后 :
if(textStiffness != null){
textStiffness.setText((""+(int)stiffness).replaceAll(",", ""));
}
我检查了该字段中设置的文本及其正确的 10000,但随后更改为 10,000,我不明白为什么