How can I change the transparency (alpha) of a view on pre-SDK-11 on Android?
Before you suggest using a background colour with some transparency, please note that this method does not include all elements in the view such as the text of a button or the child views of a view group.
EDIT – example below refers for Android pre-SDK11, but I just found out about an amazingly great library called Nine Old Androids, The amazing thing it does is enabling all animation capabilities of Android 3.0 for all API versions!!!
Previous answer
I actually encountered this kind of problem when wanted to set alpha dynamically on a complex layout.
I created an override of
onSetAlpha()and added another recursive function that checks every kind of view for background image, drawables and text colors.You can add other kinds of views as you need.