从Android中的复选框中删除“框” [英] Removing the 'box' from the checkbox in Android
问题描述
我是入门级软件开发人员,已经从该网站上找到了很多不错的答案,但是我似乎找不到如何在Android中隐藏复选框的框。当用户选择一个选项时,我只希望显示复选标记。以下是我尝试过的一些最新操作。
I am an entry level software developer, and have found tons of great answers from this site, but I can't seem to find how to hide the 'box' of a checkbox in Android. I just want the check mark to show, when a user selects an option. Here are some of the most recent things I have tried.
chkSortOrder.setBackgroundResource(android.R.color.transparent);
chkSortOrder.setBackgroundResource(android.R.drawable.checkbox_off_background);
chkSortOrder.setBackgroundResource(android.R.color.transparent); chkSortOrder.setBackgroundResource(android.R.drawable.checkbox_off_background);
这两个都仍显示在框中。
Both of these still show the box.
推荐答案
将以下属性放入XML的复选框标签中。
put the following attribute in your checkbox tag in XML.
android:button="@android:color/transparent"
这篇关于从Android中的复选框中删除“框”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!