android - Transparent widget background? -


on android widgets, how can give background color, yet make transparent @ same time? please see background on clock @ screenshot. it's black, yet transparent background. how can on own widget? can maybe reference system colors, 1 on screenshot htc sense? hint!

enter image description here

you have specify alpha-channel (=transparency channel) ressources.

if using standard color in xml res (e.g. colors.xml) fill background, may specify alpha changing first 2 numbers. example format:

<color name="transparent_red">#99ff0000</color> 

the 99 here indicates alpha value, change ff produce solid red, changing 00 make entire color invisible. test around changing value inbetween.

for details this, please here.

if want use actual picture/bitmap, sense 1 does, have create png-images alpha channel specified. depends on software using create bitmaps. recommed vector graphic programs illustrator or inkscape doing this, have alpha value when specify color. after created there, export image png , add apps ressources.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -