Search code examples
androidfloating-action-button

Floating Action Button colour


I am using one of the preset button designs (an add button) for my FAB. I was able to change the colour of the background colour of the button but the plus is green and I want to change that. How can I change that?


Solution

  • Using

    android:tint

    property you can set the color like this

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:tint="@android:color/white"
        android:src="@android:drawable/ic_input_add" />
    

    Hope this helps. Good luck :)