Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Change toggleButton color  RSS feed

 
John Joe
Ranch Hand
Posts: 372
3
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: 372
3
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!