Closed w2396631304 closed 3 years ago
<com.kyleduo.switchbutton.SwitchButton android:layout_width="@dimen/dp_65" android:layout_height="match_parent" android:layout_marginStart="@dimen/dp_15" app:kswBackColor="#4698FC" app:kswTextOff="否" app:kswTextOn="是" app:kswThumbColor="@color/white" app:kswTextExtra="@dimen/sp_12" app:kswTextThumbInset="@dimen/dp_5" app:kswAnimationDuration="500" app:kswThumbHeight="@dimen/dp_25" app:kswThumbWidth="@dimen/dp_25"/>
Just using the android:textColor attribute, and providing a color selector.
android:textColor
<com.kyleduo.switchbutton.SwitchButton android:layout_width="@dimen/dp_65" android:layout_height="match_parent" android:layout_marginStart="@dimen/dp_15" app:kswBackColor="#4698FC" app:kswTextOff="否" app:kswTextOn="是" app:kswThumbColor="@color/white" app:kswTextExtra="@dimen/sp_12" app:kswTextThumbInset="@dimen/dp_5" app:kswAnimationDuration="500" app:kswThumbHeight="@dimen/dp_25" app:kswThumbWidth="@dimen/dp_25"/>