• Post Reply Bookmark Topic Watch Topic
  • New Topic

Change toggleButton color

 
John Joe
Ranch Hand
Posts: 145
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to change the color of toggleButton in listView? I use done.png as toggleButton image. When it is clicked, it will turn to green,otherwise it remains red. However it always shows the original color which is white !

Please help me. Thanks.

This is how I deigned my toggleButton



selector



toggle_on



toggle_off



MyActivity



 
John Joe
Ranch Hand
Posts: 145
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone here can help   
 
Brian Tkatch
Bartender
Posts: 568
25
Linux Notepad Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that's the correct attribute? ToggleButton shows inherited attributes From class android.widget.CompoundButton which include color in the name, but i do not see android:color.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!