Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make com.google.android.material.button.MaterialButton text lower case

How to make the text lowercase for MaterialButton? textAllCaps="false" is not working for me. I am using com.google.android.material:material:1.0.0-alpha3

<com.google.android.material.button.MaterialButton
    android:id="@+id/material_button"
    style="@style/Widget.MaterialComponents.Button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_label_enabled"/>
like image 551
Jeffrey Liu Avatar asked Jun 27 '18 21:06

Jeffrey Liu


People also ask

How do you make a lowercase text button?

There is a property in <Button> that is android:textAllCaps="false" that make characters in which you want in your own Small and caps. By Default its became True so write this code and make textAllCaps=false then you can write text on button in small and Caps letter as per your requirement.

What is the difference between Button and material button in Android Studio?

Material Buttons are slightly different to traditional Android buttons in that they do not include additional insets (4dp on the left/right) and have more letter-spacing, different default colors and other attributes that improve legibility and affordance amongst other components.

How do I add an icon to a material button?

Add icons to the start, center, or end of this button using the app:icon , app:iconPadding , app:iconTint , app:iconTintMode and app:iconGravity attributes. If a start-aligned icon is added to this button, please use a style like one of the ". Icon" styles specified in the default MaterialButton styles.


1 Answers

You need to set both textAllCaps and android:textAllCaps to false to disable all capitalize setting.

like image 188
Hossein Seifi Avatar answered Oct 21 '22 03:10

Hossein Seifi