I'm looking for an easy way to create an indicator light that I can toggle on and off. Ra开发者_高级运维diobuttons seem great for this, they even look like lights, but you can't toggle them off. Is there an easy way to modify them so that they can be toggled off? Or is there an even simpler solution?
(I'd rather not use the toggle button, I need a round light)
You could try using a RadioButton and override the onClick(...)
method to simply toggle the checked state yourself with...
myRadioButton.setChecked(!myRadioButton.isChecked());
I'd suggest that you subclass an image view and toggle the image and state yourself.
精彩评论