简体   繁体   中英

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM