Sunday, 17 February 2013

Transparent background

While working on  android widgets, some time we want to use transperent background. For this purpose we can use either transparent images or transparent colors as background of the widget.

Transparent Color

android:background="#TTRRGGBB"" here RR, GG, BB are the (hex) red, green, blue components, and TT is the transparency component. Use TT = 80 (hex) for 50% transparency, FF for no transparency, 00 for fully transparent or use same in XML
<color name="transparent_red">#99FF0000</color>

Transparent Background Image

For this you have to create PNG-images with an alpha channel specified. That depends on which software you are using to create your bitmaps. You can use many programs like Illustrator or Photoshop.

No comments:

Post a Comment