Android:EditText输入类型为数字时键盘闪烁

Bin*_*ran 5 keyboard android android-layout android-edittext

我有一个列表项的布局。在该布局列表项中,我有一个编辑文本,输入类型为数字。

我的问题是,当我单击编辑文本时,键盘会随着普通的字母数字键盘和数字键闪烁。

我不知道为什么会这样。

Layout.xml

  <EditText
                android:id="@+id/edit_quantity"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/total"
                android:layout_centerHorizontal="true"
                android:background="@color/bg_white"
                android:gravity="center"
                android:inputType="number"
                android:maxLength="4"
                android:maxLines="1"
                android:minWidth="@dimen/view_cart_count_min_width"
                android:paddingLeft="@dimen/padding_normal"
                android:paddingRight="@dimen/padding_normal"
                android:textSize="@dimen/text_medium" />
Run Code Online (Sandbox Code Playgroud)

Manifest.xml

    <activity
        android:name="com.manoramaonline.entedeal.MyCartActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize|stateVisible" >
    </activity>
Run Code Online (Sandbox Code Playgroud)

当我将softInputMode更改为adJustPan时,键盘flickirinf停止了,但是屏幕没有调整大小。因此,键盘位于布局上方。

当android:windowSoftInputMode通过编辑文本输入类型编号调整大小时,键盘闪烁

当打开软键盘时,我有任何减小屏幕尺寸的解决方案。

小智 0

android:windowSoftInputMode="stateVisible|adjustPan"

用这个