Android Imageview Png Transparency
12 4k 4 4 gold badges 31 31 silver badges 62 62 bronze badges.
Android imageview png transparency. The problem is that for some reason android studio makes the logo s background white even though the original image has a transparent background. When i add it to an image view in a relative layout the alpha channel is lost. 55 4k 119 119 gold badges 345 345 silver badges 545 545 bronze badges. Color name black 99000000 color if you want to add 20 or 30 transparency you should pre pend two more characters to the hexadecimal code like cc.
Some opacity code you can use in android. Sheehan alam sheehan alam. When you set imageview1 bitmap homeicon the system sets the background property to a bitmapdrawable replacing the previous background. Asked sep 29 10 at 2 30.
Image in android studio. You must set the background color of the png images to transparent. I have saved a png image into the drawable folder in android studio. Here s an image to show you the.
When you set imageview1 color colors transparent the system sets the background property to a colordrawable. Hey there i have an image above which i want to place another image. If you want to add 20 or 30 transparency you should pre pend two more characters to the hexadecimal code like cc. This setting it grey works perfectly well until i actually call the png file.
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. I m also trying to change the imageview s background color to say grey. If you use a drawable xml image you can make it transparent as shown in the picture below or you can use a color code. Share improve this question follow edited dec 14 17 at 3 20.
Add a comment 3 answers active oldest votes. Even though it s a transparent png image android studio makes its background white. A logo with a transparent background to be exact. Android png imageview drawable.