问题
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