To make a TextView text look transparent we need to set the android:alpha attribute to it.
It has a range of 0-1,
If you set android:alpha ="0.1" the text will be 90% transparent, whereas
If you set android:alpha ="0.9" the text will appear 10% transparent (i.e. almost opaque)
You can set alpha manually in XML view, or by simply using the Properties window in the design view of Android Studio (or eclipse equivalent)

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.7"
android:text="@string/hello_world" />
✏️ Note that the alpha attribute is available from API level 11 and higher, so if you are using minSDK levels below level then you won't get any error but the application will simply ignore this attribute and you will not be able to see the effect.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!