Reputation: 99
I want to change the opacity of my bg in my textview, not the text only.
How to do this?
As I mentioned, it's not a duplicate question, because I don't want to change my textview opacity, i want to change my tv bg opacity, so it's a different question.
I have an image behind my text, that I want to change.
Thanks!
Upvotes: 0
Views: 37
Reputation: 445
One possibility its applicate alpha to image in Photoshop or something similar.
Another possibility its define image in xml source, and applicate this image to edittext background across style.xml Something like this:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/your_drawble"
android:alpha="77">
</bitmap>
Another possibility its use this (values between 0-255):
textView.getBackground().setAlpha(51);
Upvotes: 1