Android空格键无法正常工作 [英] Android Space Bar Is Not Working

查看:134
本文介绍了Android空格键无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Android项目中,我已将Edittext限制为仅允许Alphanumeric个字符.我使用下面的代码片段来实现

In my Android project I have restricted Edittext to allow only Alphanumeric characters. I have using below code snippet to achieve this

    <EditText
            android:id="@+id/edt_text"
            android:layout_width="140dp"      
            android:layout_height="wrap_content"                                   
            android:layout_margin="5dp"                                                 
            android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
            android:ems="10"
            android:imeOptions="actionNext"
            android:maxLength="8"
            android:padding="5dp"
            android:singleLine="true" />

但是在使用此代码时,如果我点击soft keypad中显示的Space Bar,它将充当BackSpace按钮并删除EditText中的字符.任何人都可以帮助我解决这个问题.

But while using this code if I tab the Space Bar showing in soft keypad it is acting as a BackSpacebutton and removing the characters in EditText. Anyone please help me to solve this issue.

推荐答案

我知道为时已晚,但是问题出在您设置的input数字限制上.

I know it's very too late, but the problem is in the input digit restriction you have set.

这篇关于Android空格键无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆