您的位置:首页 > 其它

自定义checkbox,自定义button

2015-10-29 13:36 239 查看
<style name="custom_checkbox" parent="@android:style/Widget.CompoundButton.CheckBox">
    <item name="android:button">@drawable/comfirm_selector</item>
</style>
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">    <item android:drawable="@drawable/icon_comfirm_normal" android:state_checked="true"/>    <item android:drawable="@drawable/icon_confirm" android:state_checked="false"/>    <item android:drawable="@drawable/icon_comfirm_normal"/></selector>
<CheckBox    android:layout_alignParentRight="true"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    style="@style/custom_checkbox"    android:id="@+id/button_yes"    android:checked="true"    />
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
<ImageButton    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:id="@+id/button_his"    android:background="@drawable/his_selector"     />
//图片选择的背景
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">    <item android:drawable="@drawable/his_nor" android:state_pressed="false"></item>    <item android:drawable="@drawable/his_press" android:state_pressed="true"></item>    <item android:drawable="@drawable/his_nor" android:state_window_focused="false"></item></selector>
颜色选择的背景

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: