开发者

Creating an Android indicator light

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜