【发布时间】:2019-07-27 22:40:18
【问题描述】:
我正在使用根据复选框状态更改的自定义背景颜色,因此我的背景属性已被使用。大多数建议告诉我将背景设置为@null。我只想保留文本并删除左侧的框。
我已经可以改变背景颜色和文本颜色了。我只是想移除盒子。
<CheckBox
android:text="CheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/checkbox_selector"
android:textColor="@color/checkbox_text"/>
【问题讨论】:
-
感谢您的所有回答。不过我找到了,只需要添加 android:button="@android:color/transparent"