I found this by Romain Guy and it worked perfectly

http://groups.google.com/group/android-developers/msg/0714e077e25d63a6

On Dec 18, 6:09 am, alan <[email protected]> wrote:
> if you use a state drawable then you can do this you need the
> "<selector>" xml element, its not very well documented but if you have
> the android source you can get some examples from there
>
> On Dec 18, 6:10 am, Robert Green <[email protected]> wrote:
>
> > My goal is to have a method for creating buttons in that I can use
> > custom backgrounds (one for normal and one for highlighted/selected
> > state) and use the normal text drawing on top of it.
>
> > Just setting the background on a regular Button works except for no
> > highlighting.  ImageButton can't draw text.
>
> > Does this require a custom class?  If so, would it be better to extend
> > Button or ImageButton?  I really want all the regular button
> > functionality with focus and selection but just using my 2 background
> > images.
>
> > Also - if anyone has done this, can I get a little code snippet?  I'd
> > like to avoid reinventing the wheel.
>
> > Thanks!
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to