foo*_*512 4 android custom-controls
我试图改变Android按钮的外观,但我无法让它工作.我在"custom_button.xml"中使用此代码来处理按钮的绘制:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/btn_normal"
/>
<item android:drawable="@drawable/btn_over"
android:state_pressed="true"/>
Run Code Online (Sandbox Code Playgroud)
在我的布局文件中,我将按钮的背景设置为custom_button drawable.正常状态有效(首次出现的状态),但按下按钮时图像不会改变.我仔细检查以确保我使用不同的图像而且我是.有谁知道为什么这不起作用?
谢谢!