在 EditText 中隐藏初始零值?
我一直在努力解决这个问题:我有几个 EditText(十进制数字)字段,并且我已为它们分配了 Double 值零。我不知道如何在用户触摸字段 EditText 之前隐藏零,实际上我的意思是我想让该零不可见,因此当用户查看包含这些字段的当前屏幕时,编辑文本字段显示为空当他触摸文本字段并输入时,零将被他输入的数字覆盖,并且用户未键入任何内容的每个其他文本字段将保留分配给它的值 0。 我的主要目标是仅当分配了 0 时才使编辑文本字段显示为空。 提前致谢 !
I've been struggling with this problem: I have a couple of EditText(Decimal Number) fields and I have assigned a Double value of zero to them. I can't figure out how to hide the zero before the user touches the field EditText,actually what I mean is I want to make that zero invisible, so the edit text field appears empty when the user looks at the current screen containing these fields.When he touches the text field and enters the zero would be overwritten by the number he entered, and every other text field where the user did not type anything would remain value 0 assigned to it.
My main goal is to make the edit text field appear empty only if there is a 0 assigned to it.
Thanks in advance !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果数字为零,请尝试在 EditText 字段上调用
setText("")
。Try calling
setText("")
on the EditText field, if the number is zero.