Saturday, March 14, 2015

Set transparency level for a view in android

You can set alpha value(transparency level) by using setAlpha in xml or in java one more way to set alpha value is ..by defining transparency level in color code which you set on your view background.

Just add any one of these code before your color code

For example color code of white is #FFFFFF if you want to add 50% transparency level with this color,.   you can use code #80FFFFFF ,it will make your view 50% transparent with white color.

Here is list of code which can be used to set transparency level for a view 

100% — FF

95% — F2

90% — E6

85% — D9

80% — CC

75% — BF

70% — B3

65% — A6

60% — 99

55% — 8C

50% — 80

45% — 73

40% — 66

35% — 59

30% — 4D

25% — 40

20% — 33

15% — 26

10% — 1A

5% — 0D

0% — 00


0 comments:

Post a Comment

Don't lose faith when you see others receive answers to their prayers

An elephant and a dog became pregnant at same time. Three months down the line the dog gave birth to six puppies. Six months later the dog...

 

G-Expo Template by Ipietoon Cute Blog Design