ImageButton background color

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

ImageButton background color

Postby lggaleon » Sun Feb 15, 2009 4:36 am

Hi, everybody!

I created an ImageButton in my XML file. It appears with white background,
if not clicked and orange background, if clicked. How can I change this colors?

Thanks in advance.
lggaleon
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Feb 15, 2009 4:23 am

Top

Postby kali » Mon Feb 23, 2009 9:46 am

hai,
the white & orange is its default color you can't change it
but what u can do is ,
y can change is back ground by putting an image
i hava written a code for ugly.png image that i have
android:background="@drawable/ugly_487"
just put a image in drawable and give its name to here y will get image
kali
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 27, 2009 1:31 pm

Re: ImageButton background color

Postby jagtap.jj1 » Mon Feb 23, 2009 1:26 pm

u can set diff background color using

"imageButton. setBackgroundColor(int color) " where int color=0x8000ff00 for green bg color
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby kali » Mon Feb 23, 2009 1:49 pm

hai thanks buddy
i have tried this one
its working
thanks
kali
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 27, 2009 1:31 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests