Transparency in Background Picture

165 Views Asked by At

I want to achive that I have a transparent background BUT with a picture ! So if got this in the XML file of my layout :

android:background="@drawable/wallpaperpic"

Now I want to transparent it so the background menu (f.ex. widgets or app menu) is seeable but also my drawable/wallpaperpic and the rest of my buttons etc are normal (100%).Hopefully I was able to express my self !

My Background : https://amazingpict.com/wp-content/uploads/2015/04/polygon-texture.jpg

I want to have thisenter image description here

WHERE you also can see my background picture a bit

5

There are 5 best solutions below

1
On

Try to set the alpha property of the view, like:

yourView.serAlpha(10);
1
On

If, as I'm guessing now, you have two layouts, one within the other, where the parent layout has the background, you can do this in the child layout:

android:background="@null"

This way, you can see the background, and your elements are intact.

0
On

Option 1 is to convert your image to a PNG and add an alpha channel.

Option 2 (which I would recommend) is to have a separate view that acts as your background, and set the alpha property for this view only. You can use a FrameLayout to put this background view underneath your other controls.

0
On

In my opinion use TintableBackgroundView.

TintableBackgroundView.

0
On

If you launch your activity the normal way, the system will not render anything behind it (i.e. the launcher will be completely gone - it could even remove it from memory).

You'll need to implement your activity as an alert window. This answer has details on how to implement it.