【问题标题】:why can I enter numbers in textPersonName? [duplicate]为什么我可以在 textPersonName 中输入数字? [复制]
【发布时间】:2020-04-24 08:31:19
【问题描述】:

我只想在键盘上输入字母,不输入数字,我用了这个方法,但它不起作用,为什么?

                <EditText
                android:id="@+id/name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPersonName" />

【问题讨论】:

标签: java android kotlin


【解决方案1】:

你可以使用

<EditText
  android:id="@+id/name"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:digits="qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM"
/>

需要测试

【讨论】:

    猜你喜欢
    • 2016-08-19
    • 2022-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-08
    • 2010-10-28
    • 2012-12-31
    相关资源
    最近更新 更多