Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Change toggleButton color  RSS feed

 
John Joe
Ranch Hand
Posts: 358
2
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: 358
2
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone here can help   
 
Brian Tkatch
Bartender
Posts: 598
26
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!