1

I want to change the opacity of some cell of my ListView.

I don't know the color to apply, only the alpha, so I can't use :

v.setBackgroundColor(0x44FFFFFF);

I have to use somethings like :

v.setAlpha(50);
Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57

2 Answers2

3

Yes you can use setAlpha.

The function View.setAlpha(float) expects a value between 0 and 1.

See here: http://developer.android.com/reference/android/view/View.html#setAlpha%28float%29

mapodev
  • 988
  • 8
  • 14
0

You can try this too:

myView.setBackgroundColor(getResources()
            .getColor(R.color.translucent));//here translucent = "#80FFFF" ARGB format

Please refer here for more details on transparency values.

Community
  • 1
  • 1
Illegal Argument
  • 10,090
  • 2
  • 44
  • 61