Enable button lock on Android virtual keyboard

I have an edit text box. When the user clicks on it by default, it displays small letters on the virtual keyboard.

I want to display the first letters by default and the rest on the keyboard.

How can I do that?

+7
android input keyboard
source share
5 answers

Try adding android:capitalize="sentences" to the EditText definition in your Layout file. This should be capitalize first character of the sentence. If you want to start each word with a capital letter, use the words.

You can learn more about this in the API .

+6
source share

android:capitalize deprecated. So please use: android:inputType

 android:inputType="textCapSentences" 
+7
source share

To capture each EditText character, use this property.

 android:capitalize="characters" 
+5
source share

I used the textCapCharacters attribute below in my EditText to enable textCapCharacters locking on the virtual keyboard, and it worked.

 android:inputType="textCapCharacters" 
+2
source share

To use all keyboard characters, use this in edittext in xml:

 android:inputType="textCapCharacters" 

To use the first character of each sentence, use this:

 android:inputType="textCapSentences" 
0
source share

All Articles