先来看一下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 控件的使用方法,包括如何添加依赖项及在布局文件中配置属性,如背景颜色、文字等内容。
1万+

被折叠的 条评论
为什么被折叠?



