Android L - Floating Action Button (FAB)

前端 未结 4 722
日久生厌
日久生厌 2020-12-22 21:46

Did Google already released a defined style or a component for this new circular FAB button or should I implement the design on my own?

The button is described here:

4条回答
  •  不思量自难忘°
    2020-12-22 22:28

    Google now provides an official library, called design library, containing the Fab Button. Just add the following Gradle dependency:

    compile 'com.android.support:design:22.2.0'
    

    Afterwards you can use the fab button like this:

    
    

    More information can be found in their announcement

    http://android-developers.blogspot.ch/2015/05/android-design-support-library.html

    or on the javadoc page

    http://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html

提交回复
热议问题