Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing backgroundcolor of a view in android

Removing Background color in Android

I have set backgroundColor in code like this,

View.setBackgroundColor(0xFFFF0000); 

How to remove this background color on some event?

like image 832
sat Avatar asked Oct 29 '10 10:10

sat


2 Answers

You should try setting the background color to transparent:

view.setBackgroundColor(0x00000000);

like image 200
kiki Avatar answered Sep 18 '22 14:09

kiki


You can use

View.setBackgroundColor(Color.TRANSPARENT);

or

View.setBackgroundColor(0);

Please remember that almost everything visible on the screen extends View, like a Button, TextView, ImageView, any kind of Layout, etc...

like image 27
Zeus Avatar answered Sep 18 '22 14:09

Zeus