I want to make my FloatingActionButton
much bigger with custom width and height. I find out that this is possible only if I add this as a child in FrameLayout
or in CoordinatorLayout
. On Lollipop and Marshmallow it looks good. But on pre-Lollipop the shadow from FloatingActionButton
is very strange. Is it a bug from Android or I did something wrong?
<android.support.design.widget.CoordinatorLayout
android:id="@+id/help_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<android.support.design.widget.FloatingActionButton
android:id="@+id/my_btn"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher" />
</android.support.design.widget.CoordinatorLayout>
I also tried to add and app:borderWidth="0dp"
but with no luck.
This is how it looks in Kitkat:
Fab button is available under two default dimensions. Normal (56dp), Mini (40dp)
But you can override this values by adding followings code in dimens.xml (under values).
<dimen name="design_fab_size_normal">150dp</dimen>
<dimen name="design_fab_size_mini">30dp</dimen>
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