Detailed explanation of floating action button instance in Android
Detailed explanation of floating action button instance in Android
1、 Introduction
This class inherits from ImageView, so we can use all the properties of ImageView for this control
2、 Use preparation and write in the build.grade file of as
3、 Instructions for use
You can see that we use the app attribute, so we need to add this attribute to the root container.
Attribute introduction:
1. App: borderwidth = "" ------------------ border width, usually set to 0, is used to solve the problem that shadows cannot be displayed normally on Android 5. X devices
2. App: backgroundtint = "" ------------------ the background color of the button is not set. The color of coloraccent in theme is used by default
3. App: ripplecolor = "" ------------------ click the edge shadow color
4. App: elevation = "" ------------------ width of edge shadow
5. App: pressedtranslationz = "16dp" --- when clicking a button, the width of the button edge shadow is usually set to be greater than the value of elevation
design sketch:
Thank you for reading, hope to help you, thank you for your support to this site!