I have an array of editTexts which I make like this:
inputs[i] = new EditText(this);
inputs[i].setWidth(376);
inputs[i].setInputType(InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);
tFields.addView(inputs[i]);
I want every character to be capitalized. Right now, the first letter of the first word is lowercase, then all the characters afterwords are upper case. I can take what the user inputs after they are done and convert that to uppercase, but that's not really what I'm going for. Is there a way to get these fields to behave the way I want them to?
To capitalize the first word of each sentence use :
android:inputType="textCapSentences"
To Capitalize The First Letter Of Every Word use :
android:inputType="textCapWords"
To Capitalize every Character use :
android:inputType="textCapCharacters"
As of today, Its
android:inputType="textCapCharacters"
This would work
0x00001001 corresponds to "
textCapCharacters
constant.This will make all the characters uppercase when writing.
Original answer here.
You can try this:
It worked for me. =)
try using this single line of code in your xml: