Hello Everyone! In this post, I want to share how to set transparent background of a control on Android?? If you want to add 20% or 30% transparency, you should pre-pend two more characters to the hexadecimal code, like CC. Like:  android:background="#CCFF0088" in XML, where CC is the alpha value, FF is the red factor, 00 is the green factor, and 88 is the blue factor. Some opacity code:

Another Example:  Use the below code for black:

Now if you want to use opacity then you can use the below code:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.