Home / Android F F P / How to change fab(floating action bar) color android

How to change fab(floating action bar) color android

Floating action bar is an attractive implementation in android material design. Any one can do special activity with the help of this button.

How to change floating action bar(fab) color as android developer:

Method 1: Change floating action bar(fab) color in xml:

To change floating action bar(fab) color just follow this step

just add “app:backgroundTint=”#colorcode” ” in xml of floating action bar(fab) ..  For example

at the place of #8393ca add any color code you want

Example as usaage..



Method 2: Change floating action bar color programmatically

just add this line on your code

Firstly create a color red in your values=>colors then add this code in your activity on create



Then your floating action bar(fab)’s background color will be red. 🙂

That’s all for today .. For more attractive trick stay with androidrace 😀

About Rana

Love to do fun with programming and build something new.. :)

Check Also


How to refresh activity on new notification click – Android developer

In some case we face this kind of issue.. In a specific activity we are …

Leave a Reply

Your email address will not be published. Required fields are marked *