Is there a way to easily make a textview's text transparent if the textview has a background color? The goal is for text to be transparent, thus showing the parent view's background
🙌 1
😶 3
Scott Kruse
03/24/2021, 10:42 PM
Here's an example of what i'd like it to look like
🦠 1
Scott Kruse
03/24/2021, 10:43 PM
I was hoping there was some tintmode i could use to achieve this
Scott Kruse
03/24/2021, 10:48 PM
Maybe will have to use Canvas / extend TextView?
l
Lena Brusilovski
03/25/2021, 5:59 AM
maybe you could just extend textview, and check. if a background is set, then change the color of the text to transparent
o
Owain Evans
03/25/2021, 6:21 AM
My best guess is that you render the text to a canvas, and use it as an inverted mask to draw a white image. It's how I would do this in a paint program.
✅ 1
s
Scott Kruse
03/25/2021, 3:39 PM
@Owain Evans this is what had to be done to achieve this effect 👍 i found a couple similar threads of devs attempting this and somebody ended up getting a small library up that outlines the concept: https://github.com/gilvegliach/TransparentTextTextView