So I am trying to adjust the alpha of a view programmatically. As of API 11 there is View.setAlpha(alpha) which works great. My app otherwise supports back to API 4 so is there another way to set the alpha for a view?
Asked
Active
Viewed 864 times
2 Answers
0
Try View.setBackgroundColor with a color that includes transparency as the first set of hex values before the RGB values (for fully visible red that would be #FFFF0000 - FF for alpha and FF0000 for RGB).
-
Unfortunately I am not just adjusting the background alpha, but the alpha for the entire view (Which may include images, text, etc.) – Flynn Mar 08 '12 at 20:33
-
A lot of people are backporting code from Honeycomb and ICS to earlier API levels. If you get your hand on the implementation of setAlpha in API 11 you may be able to figure out something. Not a trivial project, though. – Theo Mar 08 '12 at 20:37