The graphics for buttons and other widgets are implemented as the background of the view. By settings the background, you are replacing the standard widget background with your own. In this case, it is a solid green color, so the entire rectangle of the view is filled with that.
On Sun, Aug 22, 2010 at 4:56 PM, ecforu <[email protected]> wrote: > I have a button on my app that I want to change the color of during > different states of my application. However when I call > > btn.setBackgroundColor(Color.GREEN); > > the shape of the button changes. The rounded edges go away and I get a > flat looking rectangle that is green. Is there a reason the shape is > changing? Is there a a way to change the button color without the shape > changing? > > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

