In most cases u want add image as textView background. It's so easy. In layout xml file u must write:
<textview android:background="@drawable/bubble" android:id="@+id/textViewSMS" android:layout_gravity="center_vertical" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="A normal PNG file (*.png) will be loaded with an empty one-pixel border added around the image, in which you can draw the stretchable patches and content area. A previously saved 9-patch file (*.9.png) will be loaded as-is, with no drawing area added, because it already exists." </textview>Then u will see result as following:
Of course u want see text in bubble :) For this u must edit image with 9patch
Then save image as 9.png and add to project drawable folder. Save project and run again if everything goes ok u must see result as following:
If u find this post useful then don't forget leavecomment :)
Hi, thanks for great tutorial.
ReplyDeleteMay i know exactly where to put the 9.png?
Not at all. Put your imagename.9.png file in the same folder which pngs are. So put in in your drawable folder and enjoy :)
ReplyDeletegud
ReplyDeletethank you, it is working for me. :)
ReplyDelete