gpt4 book ai didi

Android InputType密码和InputType数字不取数字

转载 作者:行者123 更新时间:2023-11-29 02:22:52 27 4
gpt4 key购买 nike

我正在使用 MaterialEditText 库。虽然我尝试删除 MaterialEditText 库并使用普通的 EditText 也不起作用。

问题是当我尝试将 inputType="textPassword"inputType="number"inputType="numberDecimal" 我的editText 不以数字作为输入。

我试过多部手机。据我所知,它在三星手机中正常工作,但在其他手机中却无法正常工作。

我错过了什么吗?

<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/mobile_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:hint="@string/mobile_number"
android:inputType="numberDecimal"
android:textSize="@dimen/font_size_sub_normal"
app:met_clearButton="true"
app:met_floatingLabel="normal"
app:met_floatingLabelTextColor="@color/colorPrimary" />

即使我使用普通的 editText 它也不起作用。

如果我删除了 InputType,它就会起作用。

编辑:我刚刚发现问题出在 Google 键盘上。三星键盘一切正常,但谷歌键盘的 inputType 不工作。在不计算数字的意义上不起作用

最佳答案

尝试使用google提供的解决方案(support library) EditText with TextInputlayout

关于Android InputType密码和InputType数字不取数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54196577/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com