V
V
VovaShumel2017-09-29 05:54:59
Android
VovaShumel, 2017-09-29 05:54:59

How to completely replace the Floating Button in Android with your own image?

How to completely replace the image of a round Floating Button in your Android application with your own image?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rainmatic, 2017-09-29
@rainmatic

It is possible via XML:

android:src="@drawable/your_icon" // change background icon
app:backgroundTint="@color/your_color" // change background color

Or through code:
mFab.setImageResource(R.drawable/your_icon);

V
VovaShumel, 2017-10-02
@VovaShumel

Do you have a given icon displaying the entire FAB using this code? Those. can I put a png image with a transparent edge, and visually the button will be of an arbitrary shape? I only fit a small image in the center of the FAB.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question