android - 如何在 EditText Android 中将小数点分隔符从 "."更改为 ","?

标签 android android-layout

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:singleLine="true"
    android:inputType="numberDecimal"
    android:digits="0123456789,"
    android:gravity="center"/>

定义数字后,它允许我使用“,”,但我面临的唯一问题是,我可以多次输入“,”。我想限制用户,以便他只能输入一个小数点分隔符,在我的例子中是逗号“,”。

最佳答案

我很确定这取决于您的设备所在的语言环境。

关于android - 如何在 EditText Android 中将小数点分隔符从 "."更改为 ","?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36721574/

相关文章:

android-layout - match_parent 不填充父级!

android - sdk\build-tools\21.1.2\aapt.exe''完成,非零退出值1

android - 使用 Volley 在正文中发布表单数据参数

android - 新的 admob Express Native 广告因 IllegalStateException 而失败

android - 将 fragment 宽度设置为屏幕宽度的百分比

android - 如何在android TextView中设置上部小文字?

java - 在 java 中使用 xstream 解析 xml (android studio)

android - 我如何管理 fragment 堆栈等 Activity

android - SimpleExpandableListAdapter 中的参数是如何利用的?

android - Systrace 中的 VerifyClass 是什么意思?