F. Dev F. Dev - 1 year ago 131
Android Question

Android styles doesn't allow colors

I'm new on android development .
I'm making a program and I want to change the button style , and I can do that.

here the picture about what is the button style recommend :
enter image description here

as you see it is smooth and pretty ! But when I want to change the color of the button ( with a style ) I got problem ! :
enter image description here

how can I change the style ( Button color ) and keep the button smooth and good-looking ?

Answer Source

Use style as theme :


And add this style in your styles.xml

<style name="blackButton" parent="Widget.AppCompat.Button.Colored">
        <item name="colorButtonNormal">@android:color/black</item>
        <item name="colorControlHighlight">@color/colorAccent</item>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download