Janusz
Janusz

Reputation: 189474

Is it possible to set the transparency of a view in Android?

I would like to change the transparency of a whole View in Android. How can I do that? The View has a nontransparent background.

Upvotes: 3

Views: 7785

Answers (2)

Janusz
Janusz

Reputation: 189474

Since API Version 11 it is possible to set the opacity of a view with setAlpha().

For older Versions it may be possible with the NineOldAndroids backport of View property animations.

Upvotes: 5

Paul Grime
Paul Grime

Reputation: 15104

View.setBackgroundDrawable. Use a ColorDrawable with the appropriate alpha value?

Upvotes: 0

Related Questions