Matirial Design for Button:Raised Button


A typically rectangular material button that lifts and displays ink reactions on press.
How to add?
I. In your build.gradle add latest appcompat library.

II. Make your activity extend

III. Declare your Button inside any layout.xml file

How to style?


I. Declare custom style in your styles.xml file.

II. Apply this style to your Button via android:theme attribute.

Compatibility issues
I. To change Button color of pressed state you can use colorControlHighlighttheme attribute, however it will only affect Lollipop version.
II. Android elevation attribute is only available on Lollipop devices therefore you will not see shadow around Button on pre Lollipop devices.

Leave a Reply