TextView 通常的用法只是进行文字的显示,但是仔细了解之后发现它可以显示图像信息。
本文将介绍此种用法:android:drawableLeft="@drawable/ic_launcher"及相应的编码方法
利用TextView 进行图像+文字的显示时,有两种方式:xml文件方式和编码方式
代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="6dip">
<TextView
android:id="@+id/myTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is a TextView with an image in the left.This is a TextView with an image in the left.This is a TextView with an image in the left."
android:ellipsize="end"
android:m