How can I add the new “Floating Action Button” between two widgets/layouts

前端 未结 10 2013
离开以前
离开以前 2020-11-22 10:31

I guess you have seen the new Android design guidelines, with the new \"Floating Action Button\" a.k.a \"FAB\"

For instance this pink button:

10条回答
  •  粉色の甜心
    2020-11-22 10:52

    With AppCompat 22, the FAB is supported for older devices.

    Add the new support library in your build.gradle(app):

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

    Then you can use it in your xml:

    
    

    To use elevation and pressedTranslationZ properties, namespace app is needed, so add this namespace to your layout: xmlns:app="http://schemas.android.com/apk/res-auto"

提交回复
热议问题