I have TextView. I would like to show text in upper case mode. Is there attributed for upper case? Just I have text in strings.xml and I need use the line in several place as lower case and upper case.
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 the layout XML, you can set the android:textAllCaps
attribute on your TextView
:
<TextView android:textAllCaps="true"></TextView>
Use String
class method while setting the text to TextView
as
tv.setText(strings.toUpperCase());
Have a look at this post for detail discussion.
EDIT: This was answered way back before API 14. As other answer mentioned here, textView.isAllCaps = true
and its java methods were introduced from TextView
. Please use those.
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