【问题标题】:Android password XML attribute - DeprecatedAndroid 密码 XML 属性 - 已弃用
【发布时间】:2017-02-19 23:30:26
【问题描述】:

我现在如何屏蔽editText?

我的 inputType 是数字。我现在应该如何屏蔽它,同时将其限制为数字?

【问题讨论】:

    标签: java android android-layout android-studio android-edittext


    【解决方案1】:

    您可以使用 android:inputType="numberPassword" 作为 EditText。

    【讨论】:

    • 谢谢!正要自己回答这个问题。
    • 很高兴我能帮上忙 :)
    【解决方案2】:

    android:inputType="number" 替换为android:inputType="numberPassword"

    删除android:password="true"

    对于inputType 可以有的每个值的解释: http://developer.android.com/reference/android/widget/TextView.html#attr_android%3ainputType

    【讨论】:

      【解决方案3】:

      使用android:inputType="numberPassword" 作为您的属性

      【讨论】:

        【解决方案4】:

        将您的android:password="true" 替换为android:inputType="textPassword"。 为inputType 提供了一个列表,例如numberPasswordnumberUriDate 等。 有关详细信息,请访问 developer.android.com。

        【讨论】:

          【解决方案5】:

          将其替换为以下属性

          android:inputType="textPassword"
          

          【讨论】:

            猜你喜欢
            • 2015-07-13
            • 1970-01-01
            • 1970-01-01
            • 2018-05-09
            • 1970-01-01
            • 2013-03-10
            • 2012-11-06
            • 1970-01-01
            • 2010-09-26
            相关资源
            最近更新 更多