I got it to work, thanks.

On Jun 4, 6:05 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> John Gaby wrote:
> > I want to provide my own images for buttons.  Now I can call the
> > setBackgroundResource(id) function to change the background of a
> > button, but it does not handle the various states.  How do I specify a
> > different image for each state (normal, pressed, selected)?
>
> You need to make that resource be a StateListDrawable.
>
> The easiest way to do this is to copy the XML for the standard Button
> StateListDrawable. You can find this in:
>
> $ANDROID_HOME/platforms/$VERSION/data/res/drawable/btn_default.xml
>
> (where $ANDROID_HOME is where you installed the SDK and $VERSION is one
> of the SDK versions)
>
> Change that to point to your own nine-patch images for your various
> button backgrounds (normal, pressed, selected).
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 2.2 Programming Books:http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to