I have an image as below.
When I use it to make a floating action button, the button looks like this.
I don't want the pink margin. I only want my image to be shown. What should I do?
I also want the size of my image to be the outer circle not the inner one.
Here is my code:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_refresh" />
Im not sure that this solution as acceptable, but it works;
You can override image size dimension for nested image in FAB. Just add to your dimens file:
<dimen tools:override="true" name="design_fab_image_size">56dp</dimen>
(I used 56dp cause fab size in guidelines is 56dp)
tools:override="true" - this is the thing why I suppose that this solution is not good, cause "design_fab_image_size" - is final, and you should insist on overriding :)
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