0

Android软键盘在导航到其他文本框时不会自动从数字模式切换到字母模式,为什么?

4

2 回答 2

0
android:inputType="select ur appropriate mode"

对于您的特定文本框

示例,如下图所示

  <EditText 
        android:id="@+id/editText1"
        android:inputType="text"=========returns text keyboard
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


<EditText 
        android:id="@+id/editText1"
        android:inputType="number"=======returns numeric keyboard
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
于 2012-11-07T10:14:21.593 回答
0

您必须使用该inputType属性来指示您想要什么类型的键盘。

例如,假设您有 2 个编辑框:

//alphabet keyboard is shown when user focus is on this box

<EditText 
        android:id="@+id/editText1"
        android:inputType="text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

//numeric keyboard is shown when user focus is on this box   

<EditText 
        android:id="@+id/editText2"
        android:inputType="number"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
于 2012-11-07T10:33:11.657 回答