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

or

 

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

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

Check Also

Show networkimageview inside circular imageview

You can use Picasso library withΒ  Circular imageview to show image from url add this …

Leave a Reply

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