Alex Rivera | Logout

android.R.color.transparent not fully transparent

Asked 2012-04-03T07:09:26.310
11

In my application, I apply the transparent background to my ListView's CustomListItem at runtime. For that I use, convertView.setBackgroundColor(android.R.color.transparent);. It works and shows transparency. But that is not fully transparent as there is some kind of shade to the background. I also tried putting my own transparent color with the values #80000000 and #00000000 but the result is worse. What can I do to get the fully transparent color?

Edit
Report

1 Answer

25

android.R.color.transparent is a resource id (referring to a transparent color definition) - View.setBackgroundColor(int) expects an actual int color.

Use View.setBackgroundResource(int) instead, which will load the actual color from resources.

answered 2012-04-03T07:12:51.570

Your Answer