• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making custom button

 
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 -
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic