zoukankan      html  css  js  c++  java
  • android 控件在不同状态下的内容样式与背景样式

    1 控件内容(如字体颜色)在不同状态下有不同的表现色
    ref:http://developer.android.com/guide/topics/resources/color-list-resource.html
    res/color/radio_state.xml
    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android" >
        <item
            android:color="hex_color"
            android:state_pressed=["true" | "false"]
            android:state_focused=["true" | "false"]
            android:state_selected=["true" | "false"]
            android:state_checkable=["true" | "false"]
            android:state_checked=["true" | "false"]
            android:state_enabled=["true" | "false"]
            android:state_window_focused=["true" | "false"] />
    </selector>

    2. 控件背景(背景样式与颜色)在不同状态下的不同表现结果:
    ref:http://developer.android.com/guide/topics/resources/drawable-resource.html
    res/drawable/radio_state.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android"
        android:constantSize=["true" | "false"]
        android:dither=["true" | "false"]
        android:variablePadding=["true" | "false"] >
        <item
            android:drawable="@[package:]drawable/drawable_resource"
            android:state_pressed=["true" | "false"]
            android:state_focused=["true" | "false"]
            android:state_hovered=["true" | "false"]
            android:state_selected=["true" | "false"]
            android:state_checkable=["true" | "false"]
            android:state_checked=["true" | "false"]
            android:state_enabled=["true" | "false"]
            android:state_activated=["true" | "false"]
            android:state_window_focused=["true" | "false"] />
    </selector>
  • 相关阅读:
    进程的经典同步问题
    数学余数在计算机的用途
    7.货仓选址 绝对值不等式
    6. 排队打水 排序不等式
    5.合并果子 Huffman树
    4.区间覆盖 区间问题
    3.区间分组 区间问题
    2.最大不相交区间数量 区间问题
    1.区间选点 区间问题
    26.拆分-Nim游戏 博弈论
  • 原文地址:https://www.cnblogs.com/atwind/p/4576782.html
Copyright © 2011-2022 走看看