I am using a web view in which I am adding an image view. How can I set the background of this image view to transparent?
I have tried this:
mImageview.setBackgroundResource(R.color.trans);
Where trans
→ <color name="trans">#00000000 </color>
.
Double-click the picture, and when Picture Tools appears, click Picture Tools Format > Color. Click Set Transparent Color, and when the pointer changes, click the color you want to make transparent.
If you add this line to the Constraint Layout xml it will become transparent: android:background="@android:color/transparent" . This will make the background see through and show what ever is bellow or overlapping.
You can actually apply a hex code color that is transparent. The hex code for transparent white (not that the color matters when it is fully transparent) is two zeros followed by white's hex code of FFFFFF or 00FFFFFF.
You can set the background transparent of any layout, any view, or any component by adding this code in XML:
android:background="@android:color/transparent"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With