gpt4 book ai didi

android - 如何在 EditText View 的焦点上默认使用字母键盘?

转载 作者:行者123 更新时间:2023-11-30 02:52:16 25 4
gpt4 key购买 nike

我的场景:

我有 2 个 EditText:

<EditText 
android:id="@+id/edt1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
android:inputType="textPassword"
android:maxLength="8"
android:singleLine="true"
android:layout_below="@+id/add"/>
<EditText
android:id="@+id/edt2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
android:inputType="textPassword"
android:maxLength="8"
android:singleLine="true"
android:layout_below="@+id/edt1"/>

当 edt1 聚焦时,我输入数字(键盘显示数字)然后我下一个 edt2,键盘仍然显示数字。

我想将键盘更改为 qwerty 键盘。

我该怎么做?

更新:我的意思是:当 EditText 获得焦点时,qwerty 键盘总是显示。

谢谢大家!

最佳答案

从两者中删除 android:digits。在第一个 EditText 中使用 android:inputType="number",在第二个中使用 android:inputType="text"

关于android - 如何在 EditText View 的焦点上默认使用字母键盘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23954268/

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