I want to use an ImageView
to show some message in a fancy way.
How do I add text to an ImageView
?
Use drawalbeLeft/Right/Bottom/Top in TextView to render image at respective position.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/image"
android:text="@strings/text"
/>
With a FrameLayout you can place a text on top of an image view, the frame layout holding both an imageView and a textView.
If that's not enough and you want something more fancy like 'drawing' text, you need to draw text on a canvas - a sample is here: How to draw RTL text (Arabic) onto a Bitmap and have it ordered properly?
You can use the TextView for the same purpose, But if you want to use the same with the ImageView then you have to create a class and extends the ImageView then use onDraw() method to paint the text on to the canvas. for more details visit to http://developer.android.com/reference/android/graphics/Canvas.html