radio button 的图片如何能够替换? radiobutton前面那个圆形的选中图片怎么替换呢?我想在选中时用一种图片,为选中的时候又是一种图片,两种图片我都想自定义,能实现么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在ListView添加图片,对图片进行控制 自己写个button继承radiobutton,然后重新处理onDraw 自己定义 selectordrawable/radiobutton.xml<selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Enabled states --> <item android:state_checked="true" android:state_pressed="true" android:drawable="@drawable/radio_on" /> ---------自己的Radio button 图片 <item android:state_checked="false" android:state_pressed="true" android:drawable="@drawable/radio_off" /> ---------自己的Radio button 图片 各种状态都定义一下.......</selector>定义Stylevalues/styles.xml<style name="Style_Radiobutton"> <item name="android:background" >@drawable/radiobutton</item></style>Layout中给Raiobutton指定Stylestyle="@style/Style_Radiobutton" 这个应该可以,按钮时这样做的,radiobutton应该也行。 自己重新定义了一下RadioButton 的Button 属性即可。楼上很多人都说了。 <item name="android:button">@drawable/radio</item> 请问手机按器软件的实现原理?如何模拟触屏事件来点击别的app android中组件显示老是重合怎么办,有截图 这个算是自定义的组件吧?怎么用,会报错 菜鸟R问题 android模拟器 关于图片和对象内存释放的问题 NDK引用自定义函数库,undefined reference问题。 找一个Android数据显示控件 怎么在map上显示自己的位置 TextView放大后 跑马灯有残留 如何让代码适应不同的设备? android 假如我现在有一个ScrollView,但它的内容还没超出屏幕,不足以实现滚动效果,如何让里面内容还能上下滚动一小段距离,并停止在当前位置
drawable/radiobutton.xml<selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Enabled states -->
<item android:state_checked="true" android:state_pressed="true"
android:drawable="@drawable/radio_on" /> ---------自己的Radio button 图片
<item android:state_checked="false" android:state_pressed="true"
android:drawable="@drawable/radio_off" /> ---------自己的Radio button 图片
各种状态都定义一下
.......
</selector>
定义Style
values/styles.xml<style name="Style_Radiobutton">
<item name="android:background" >@drawable/radiobutton</item>
</style>
Layout中给Raiobutton指定Style
style="@style/Style_Radiobutton"
<item name="android:button">@drawable/radio</item>