I’ve been wondering this for a while. What’s the best method to create custom buttons? Currently I have an image, it contains a background with a yes and no. Should I have my artists create the image with the words yes and no separate, or is there a way to create buttons on top of this background? Perhaps make the buttons transparent? Thanks!
Share
Use the Button class with a custom background drawable and desired text styling. The background drawable should be a state list selector. This will allow you to define a separate 9-patch for each state – pressed, enabled, disabled, focused, etc. The text itself will be drawn by the system on top of the button, allowing you to use localized string resources to support multiple languages.