这个呢是通过 源码的来的
<CheckBox
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:contentDescription="@string/description_star"
style="?android:attr/starStyle" />
在一个 theme中
<item name="starStyle">@android:style/Widget.CompoundButton.Star</item>
然后
<style name="Widget.CompoundButton.Star">
<item name="android:background">@android:drawable/btn_star_label_background</item>
<item name="android:button">@android:drawable/btn_star</item>
</style>
定制星形CheckBox样式
本文介绍如何使用Android原生XML定义星形CheckBox组件,并详细解释了如何创建自定义的主题及样式来实现这一功能。
225

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



