TextView可以放文本,也可以放图片,如下所示
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"
android:autoLink="email"
android:height="50px"
/>
<TextView
android:layout_width="wrap_content"
android:id="@+id/textView1"
android:text="带图片的TextView"
android:drawableTop="@drawable/ic_launcher"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/textView2"
android:textColor="#0f0"
android:textSize="20px"
android:text="多行文本:在很久很久以前,一个小偷他偷吃了我的水果"
android:width="300px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/textView3"
android:textColor="#f00"
android:textSize="20px"
android:text="单行文本:在很久很久以前,一个小偷他偷吃了我的水果"
android:width="300px"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>