Android:edittext-在字母后用句点替换第一个空格后键入两个空格 [英] Android: edittext - typing two spaces after a letter replaces the first space with a period

查看:89
本文介绍了Android:edittext-在字母后用句点替换第一个空格后键入两个空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,在edittext中,如果您键入一个(或几个)字母/秒,然后执行双倍空格,则它将第一个空格替换为一个句点-它显然认为您正在尝试输入一个新句子.我想禁用此行为-这怎么可能?

I've noticed that in an edittext if you type one (or several) letter/s and then do a double space it replaces the first space with a period - it obviously thinks that you're trying to enter a new sentence. I want to disable this behavior - how is this possible?

<EditText
            android:id="@+id/someId"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginStart="30dp"
            android:layout_marginRight="30dp"
            android:layout_marginEnd="30dp"
            android:layout_marginTop="10dp"
            android:gravity="center"
            android:hint="@string/somehint"
            android:textColorHint="@color/somecolor"
            android:textSize="20sp"
            android:textColor="@android:color/black"
            android:background="@android:color/white"
            android:paddingTop="10dp"
            android:paddingBottom="10dp"
            android:cursorVisible="true"
            android:textCursorDrawable="@null"
            />

推荐答案

这是键盘的设置,而不是您的应用程序.您可以在

This is a setting of the keyboard, not your app. You can find it under

设置>语言和输入>键盘和键盘输入法>(您的键盘)

Settings > Language & input > Keyboard & input methods > (your keyboard)

据我所知,它不能被禁用.最好的选择可能是查看输入法样式 https://developer.android. com/training/keyboard-input/style.html

As far as I am aware, it cannot be disabled. Your best bet may be to look into input method styles https://developer.android.com/training/keyboard-input/style.html

这篇关于Android:edittext-在字母后用句点替换第一个空格后键入两个空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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