I want to change com.google.android.material.chip.Chip background with alpha but when I set
app:chipBackgroundColor="#6F000000"
that not work and always have a white background. How can I do this?
So you can use the setChipBackgroundColor(ColorStateList cl) method to set the color of your chip and then you can add an setOnClickListener(new ...) to toggle with selection and non-selection like the following code: yourchip. setOnClickListener(new View.
TRANSPARENT (which represents the same thing as @android:color/transparent ) is equal to 0 . The hex representation of 0 is #00000000 , which means that Color. TRANSPARENT is essentially a completely transparent Color.
I find the solution in this link. chips have a white surface layer underneath their background and you can set the transparent color for that with this :
app:chipSurfaceColor="@android:color/transparent"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With