mtmurdock
mtmurdock

Reputation: 13062

Android: how do i make a View's background invisible?

I am working with a ListActivity, and I'm trying to add images/backgrounds, ext to make everything look nice. However i have run into a little snag.

The layout for the activity defines a background image, but the list items are not always transparent, and therefore cover up the background. If i am scrolling, or have otherwise touched a list item, the list item's backgrounds are transparent (as desired) but if i touch anything else they get a black background which covers up the Activity's background.

Is there some value i can set like, android:background="invisible" or something else to fix this problem?

TIA

Upvotes: 1

Views: 663

Answers (2)

Kevin Coppock
Kevin Coppock

Reputation: 134684

For a detailed explanation, check here: http://developer.android.com/resources/articles/listview-backgrounds.html

Basically, set android:cacheColorHint="#00000000" on the ListView. Problem solved. :)

Upvotes: 1

mtmurdock
mtmurdock

Reputation: 13062

Found my answer on another question

I set these properties in the ListView and it worked great

android:background="#00000000" android:cacheColorHint="#00000000"

Upvotes: 1

Related Questions