Android: edittext - typing two spaces after a letter replaces the first space with a period

霸气de小男生 提交于 2019-12-11 12:08:10

问题


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"
            />

回答1:


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

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

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



来源:https://stackoverflow.com/questions/31679940/android-edittext-typing-two-spaces-after-a-letter-replaces-the-first-space-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!