Is there a way to easily make a textview's text tr...
# android
s
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
Here's an example of what i'd like it to look like
🦠 1
I was hoping there was some tintmode i could use to achieve this
Maybe will have to use Canvas / extend TextView?
l
maybe you could just extend textview, and check. if a background is set, then change the color of the text to transparent
o
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
@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
🙌 1