Android EditText Input Capitalize

October 3, 2019

Options

  • textCapWords: Capitalize each words
  • textCapSentences: Capitalize first word of a sentenace
  • textCapCharacters: Capitalize everything

via xml

<EditText
    android:id="@+id/titleEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="text|textCapWords"
    />

programtically

titleEditText.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_WORDS
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.