FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

The color doesn't change

Open Neha--Agarwal opened this issue 10 years ago • 5 comments

Even when I change the color of button in its XML code, the color of button is keeping the same, blue. Why is it so? Please help!

Neha--Agarwal avatar Sep 17 '15 11:09 Neha--Agarwal

make sure you are editing fab:fab_colorNormal in your xml layout.

flaff avatar Sep 22 '15 01:09 flaff

found an answer use this

fab.setColorNormalResId(R.color.fab_colorNormal);

and set color for pressed and ripple similarly

MohammadAbbasKhan avatar Oct 09 '15 10:10 MohammadAbbasKhan

Yes, the color only could be changed by code, can't get it from xml. How to solve it ?

ghost avatar Nov 13 '15 15:11 ghost

@JackLauu fab:fab_colorNormal="@color/fab_background" this works for me. Don't know how to change item's color inside, for example: I use android:src="@android:drawable/ic_input_add" I want to change + color..

iamtodor avatar Apr 21 '16 21:04 iamtodor

To change color guys you should declare namespace xmlns:fab="http://schemas.android.com/apk/res-auto" and not xmlns:fab="http://schemas.android.com/tools"

After you do that, you can change the color programmatically or with xml.

xtonousou avatar Aug 02 '16 04:08 xtonousou