can anybody tell how to display background image in a TextView
in android?
add a android:background="@drawable/imagefile" attribute on your TextView tag. Before that you have to put your image file inside the res/drawable folder.
If you are working with xmls you can add it as Praveen Chandrasekaran said doing:
android:background="@drawable/myResouce"
Before that you have to put your image file inside the res/drawable folder.
You can also change it from the code doing:
mTextView.setBackgroundResource(R.drawable.myResouce);
add a android:background="@drawable/imagefile"
attribute on your TextView
tag. Before that you have to put your image file inside the res/drawable
folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With