18
votes

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!

2
change to imagebutton and put the background like this: android:background="@android:color/transparentDyna
Thanks very much , yes that was the problem , could you add it as an answer so I can select it. thanksm0j1

2 Answers

77
votes

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"/>
8
votes

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 ;)