国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

android開發教程之自定義控件checkbox的樣式示例

2020-04-11 11:52:25
字體:
來源:轉載
供稿:網友

主界面xml文件

復制代碼 代碼如下:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:button="@drawable/check_selector"
        android:checked="true" />
</RelativeLayout>

/res/drawable-hdpi/check_selector.xml

復制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/checkok" android:state_checked="true"></item>
    <item android:drawable="@drawable/checkno" android:state_checked="false"></item>
</selector>

P.S:重點: android:button="@drawable/check_selector"

check_selector.xml中的checkok為CheckBox選中狀態的圖片,checkno為CheckBox未選中狀態的圖片.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凤台县| 新郑市| 余江县| 金堂县| 连南| 冀州市| 陇西县| 胶州市| 北票市| 湾仔区| 临颍县| 永胜县| 肇源县| 平原县| 遵义县| 咸阳市| 连州市| 赣榆县| 田东县| 驻马店市| 大邑县| 东港市| 青铜峡市| 台东县| 油尖旺区| 怀集县| 洞头县| 辽宁省| 海南省| 灵璧县| 宜宾市| 剑河县| 三门峡市| 保康县| 青阳县| 焉耆| 中宁县| 南城县| 克什克腾旗| 驻马店市| 集贤县|