zoukankan      html  css  js  c++  java
  • 13-开关按钮Switch

    SwitchActivity.java

    activity_switch.xml

    drawable-->switch_selector.xml(图片仿ios)

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

    drawable-->switch_thumb.xml

    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval" android:layout_height="wrap_content" android:layout_width="wrap_content">
    
        <size
            android:width="40dp"
            android:height="40dp"/>
        <solid
            android:color="@color/white"/>
    </shape>

  • 相关阅读:
    Tarjan 的一些板子
    对 SAM 和 PAM 的一点理解
    一些敲可爱的数论板子
    异常
    面向对象编程
    JAVA数组
    JAVA方法
    JAVA流程控制
    JAVA基础
    JAVA入门
  • 原文地址:https://www.cnblogs.com/fdxjava/p/14800599.html
Copyright © 2011-2022 走看看