radioButton 使用

1.布局

    android:id="@+id/rg_home"
    android:layout_width="fill_parent"
    android:layout_height="60dp"
    android:layout_gravity="bottom"
  android:background="@color/white"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:paddingTop="2dp" >

  
            android:id="@+id/rb_facility_again"
        style="@style/main_tab_bottom"
        android:drawableTop="@drawable/icon_function"
        android:textColor="#96a0b1"
        android:text="@string/tab_facility"/>

            android:id="@+id/rb_aircon"
        style="@style/main_tab_bottom"
        android:checked="false"
        android:drawableTop="@drawable/icon_aircon"
        android:textColor="#96a0b1"
        android:text="@string/tab_aircon"/>

            android:id="@+id/rb_date"
        style="@style/main_tab_bottom"
        android:drawableTop="@drawable/icon_date"
        android:text="@string/tab_heater"
        android:textColor="#96a0b1"
        android:checked="false"/>


            android:id="@+id/rb_my"
        style="@style/main_tab_bottom"
        android:drawableTop="@drawable/icon_my"
        android:textColor="#96a0b1"
        android:text="@string/tab_my"/>

状态选择器

xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android">

    android:drawable="@drawable/icon_setting_blue" android:state_pressed="true">
    android:drawable="@drawable/icon_setting_blue" android:state_checked="true">
    android:drawable="@drawable/icon_setting"/>




///









你可能感兴趣的:(Android)