Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Making custom button  RSS feed

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I created a custom button in XML but it's state_pressed and state_focused states are not working. Please check what I am doing wrong. This in my code-

Thanks in advance
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got the solution. The normal state must be placed at the end of the file. Placing the normal state at the top of the file (above the other states) stops the selector from working. State selector doesn't look for the best match, instead the first that fits will make it through. So the correctly working code is -
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!