Flynn
Flynn

Reputation: 6211

Android: Way around View.setAlpha?

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?

Upvotes: 1

Views: 868

Answers (2)

Eric Burke
Eric Burke

Reputation: 4422

Apply an AlphaAnimation to the view.

Upvotes: 3

Theo
Theo

Reputation: 6083

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).

How to set background color of a View

Upvotes: 0

Related Questions