Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide only checkbox box not it's text in Android

Tags:

android

How I can hide checkbox box only, but not checkbox text in . Checkbox is created programmatically.

myCheckBox.setVisibility(View.GONE) hides the whole checkbox with text also included. I would like to show only text but not box icon.

Looking forward to hear from you soon.

like image 272
anduplats Avatar asked Sep 19 '14 11:09

anduplats


1 Answers

This works for me:

Drawable transparentDrawable = new ColorDrawable(Color.TRANSPARENT);
myCheckBox.setButtonDrawable(transparentDrawable);
like image 168
okkko Avatar answered Nov 05 '22 16:11

okkko