I have an EditText
and I need the text in it (when user types in) to be started with capital letter.
All replies. Beginning of a sentence, go to Settings -> General -> Keyboard -> Turn on Caps Lock. If you want the entire message in capital letters-> tap the ⬆︎Capital letter key twice.
You can add the android:textAllCaps="true" property to your xml file in the EditText. This will enforce the softinput keyboard to appear in all caps mode. The value you enter will appear in Uppercase.
In android, we can set the text of EditText control either while declaring it in Layout file or by using setText() method in Activity file.
Be careful if you add both android:capitalize="sentences"
and android:inputType="text"
, as the latter seems to have priority over the first and the input will not be capitalized.
There's a specific inputType
for automatically capitalizing the first letter:
android:inputType="textCapSentences"
See http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With