0

I do have a Android button in my layout file. Similar to this:

enter image description here

Code for above implememtation is :

 button.setText(Html.fromHtml("Text in Capital Letters <br/><small>(Text in small letters)</small>"));

What I want to make text in "Text in Small letters" Lowercase. How can I do that?

  • Possible duplicate http://stackoverflow.com/questions/24880388/cannot-lower-case-button-text-in-android-studio – Tobi Oct 23 '15 at 05:30

2 Answers2

2

Use this property android:textAllCaps="false" to the button.

Or you can do it by programmatically change the transformation method of the button. button.setTransformationMethod(null);

Shiladittya Chakraborty
  • 4,270
  • 8
  • 45
  • 94
0

try this.It hopefully works

In XML file add Button

<Button
    android:id="@+id/btn"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/mText"
    android:layout_gravity="center"
    android:gravity="center"/>

and in Strings.xml add

<string name="mText">TEXT In CAPITAL LETTERS\n(TEXT IN SMALL LETTERS)</string>
Naveen
  • 814
  • 2
  • 9
  • 22