Android EditText Input Capitalize

Oct 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

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.