5

setAlpha has no effect on ViewGroup instances in API levels 14(ICS)-19(KitKat) even though it was introduced in API level 11. Any ideas why?

I've even tried using the support library but that doesn't work either.

Example:

LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
ViewGroup view = (ViewGroup) layoutInflater.inflate(R.layout.my_layout, null);
view.setAlpha(0.5f);

It works perfectly fine for API levels 21+ but not for API levels 14-19.

PS, I haven't tested below API level 14.

olfek
  • 3,210
  • 4
  • 33
  • 49

0 Answers0