Android TutorialsNo Comments

b1
456 views.

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 android.support.v7.app.AppCompatActivity.

III. Declare your Button inside any layout.xml file

How to style?

b2

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.

Be the first to post a comment.

Add a comment