移除 android 按钮的阴影效果
Remove shadow effect on android button
我在我的布局中添加了一个简单的按钮,我删除了文本并设置了一个透明的图像作为其背景。但不幸的是,我的按钮上有阴影效果,我无法将其删除。如果您有这方面的经验可以帮助我,我将不胜感激。
谢谢!
你的 xml 应该是这样的:
<ImageButton android:src="@drawable/yourimagename"
android:id="@+id/button1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:background="@null"
/>
如果您有任何问题,请告诉我 ;)
在按钮标签集上
android:stateListAnimator="@null"
示例:
<Button
android:id="@+id/button1"
android:layout_height="50dp"
android:layout_width="match_parent"
android:stateListAnimator="@null"/>
我在我的布局中添加了一个简单的按钮,我删除了文本并设置了一个透明的图像作为其背景。但不幸的是,我的按钮上有阴影效果,我无法将其删除。如果您有这方面的经验可以帮助我,我将不胜感激。
谢谢!
你的 xml 应该是这样的:
<ImageButton android:src="@drawable/yourimagename"
android:id="@+id/button1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:background="@null"
/>
如果您有任何问题,请告诉我 ;)
在按钮标签集上
android:stateListAnimator="@null"
示例:
<Button
android:id="@+id/button1"
android:layout_height="50dp"
android:layout_width="match_parent"
android:stateListAnimator="@null"/>