Android ImageView Transparent Background
The source bitmap for ImageView has transparent color, we must set the background color of this ImageView to transparent color.
If not, an ImageView will overlap with another ImageView.
Those are some methods to set transparent color.
Static Setting
In xml, set background “#00000000”
1 | <ImageView |
Also can use android color : transparent
1 | <ImageView |
Dynamic Setting
In program, we could use API: setBackgroundColor.
1 | var imageView = findViewById<ImageView>(R.id.test1) |
Or use Color.TRANSPARENT
1 | var imageView = findViewById<ImageView>(R.id.test1) |
Result
Android ImageView Transparent Background
https://nickcarter9.github.io/2019/12/26/2019/2019_12_26-imageview-transparent-background/