当前位置: 首页> 房产> 建材 > 需要多少钱呢?_建站网站哪个最好_广告代理公司_外链发布的平台最好是

需要多少钱呢?_建站网站哪个最好_广告代理公司_外链发布的平台最好是

时间:2025/7/10 4:19:04来源:https://blog.csdn.net/qq_35605213/article/details/146182572 浏览次数:1次
需要多少钱呢?_建站网站哪个最好_广告代理公司_外链发布的平台最好是

 自定义Switch开关:

    <Switchandroid:id="@+id/switch_a"android:layout_width="wrap_content"android:layout_height="wrap_content"android:checked="true"android:thumb="@drawable/ccb_switch_thumb"android:track="@drawable/ccb_switch_track"/>
<!-- ccb_switch_thumb -->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_enabled="true"><selector><item android:state_checked="true"><layer-list><item android:gravity="center_vertical" android:width="20dp" android:height="20dp"  android:drawable="@drawable/switch_on_normal_ov_on"/></layer-list></item><item android:state_checked="false"><layer-list><item android:gravity="center_vertical" android:width="20dp" android:height="20dp" android:drawable="@drawable/switch_on_normal_ov_off" /></layer-list></item></selector></item>
</selector>
<!-- ccb_switch_track -->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@drawable/switch_on_normal_bg_on" android:state_checked="true" /><item android:drawable="@drawable/switch_on_normal_bg_off" android:state_checked="false" />
</selector>
<!--    switch_on_normal_ov_on-->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><sizeandroid:width="22dp"android:height="22dp" /><stroke android:width="5dp" android:color="#00000000"/><solid android:color="#ffffff"/>
</shape>
<!--    switch_on_normal_ov_off-->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><sizeandroid:width="22dp"android:height="22dp" /><stroke android:width="5dp" android:color="#00000000"/><solid android:color="#cc8C93A2"/>
</shape>
<!--    switch_on_normal_bg_on -->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><solid android:color="#2166ff" /><corners android:radius="22dp"/><sizeandroid:width="45dp"android:height="22dp" />
</shape>
<!--    switch_on_normal_bg_off -->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><solid android:color="#50787880" /><corners android:radius="22dp"/><sizeandroid:width="45dp"android:height="22dp" />
</shape>
        cSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {Log.i(TAG, "onCheckedChanged 改变状态为: "+isChecked);}});btnSwitch.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {cSwitch.setChecked(!isChecked);}});

笔记、仅供参考

关键字:需要多少钱呢?_建站网站哪个最好_广告代理公司_外链发布的平台最好是

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: