I have added a simple button to my layout , and I have deleted the text and set an image with transparency as its background. but unfortunately there is a drop shadow effect on my button and I can't remove it. I'll appreciate if you have any experience with it help me.
Thanks!
To remove the shadow of Floating Action Button in layout file, set the elevation attribute with zero value as shown in the following code snippet. Please note that the elevation attribute is referenced from xmlns:app=”http://schemas.android.com/apk/res-auto” namespace.
try to set android:elevation="0dp" to your main layout.
on Button tag set
android:stateListAnimator="@null"
example:
<Button
android:id="@+id/button1"
android:layout_height="50dp"
android:layout_width="match_parent"
android:stateListAnimator="@null"/>
Your xml , instead of the button that you have, should be like this:
<ImageButton android:src="@drawable/yourimagename"
android:id="@+id/button1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:background="@null"
/>
If you have any problems just let me know ;)
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