SwitchButton平滑按钮的实现

来源:互联网 发布:c语言中预处理命令 编辑:程序博客网 时间:2024/05/18 18:01

先来看一下switchbutton的效果
这里写图片描述
第一步需要添加依赖

dependencies {    compile 'com.kyleduo.switchbutton:library:1.4.6'}

然后就可以在布局文件中使用SwitchButton这个控件

<com.kyleduo.switchbutton.SwitchButton        android:id="@+id/switchbutton"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        app:kswBackColor="#0f0"        app:kswTintColor="#00f"        app:kswTextOn="开"        app:kswTextOff="关"        />

这里是对switchbutton的官方介绍

阅读全文
0 0