mohan mohan - 1 month ago 6
Android Question

How to display background image in text view

can anybody tell how to display background image in a

TextView
in android?

Answer

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);