android如何为带有标题文本的linearlayout创建自定义xml布局

android如何为带有标题文本的linearlayout创建自定义xml布局,android,Android,我试图创建一个xml布局,它有一个边框、一个标题和类似于此图像的内容,但我不知道如何创建标题 有人能帮忙吗?从这里开始: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:backg

我试图创建一个xml布局,它有一个边框、一个标题和类似于此图像的内容,但我不知道如何创建标题

有人能帮忙吗?

从这里开始:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/rectangle">

        <TextView
            android:id="@+id/headerText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:layout_marginRight="20dp"
            android:background="#FFFFFF"
            android:text="Text here" />
        <TextView
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/headerText"
            android:layout_alignParentLeft="true"
            android:padding="30dp"
            android:text="Text here" />
        <TextView
            android:id="@+id/text2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/text1"
            android:padding="30dp"
            android:text="Text here" />
        <TextView
            android:id="@+id/text3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/headerText"
            android:layout_alignParentRight="true"
            android:padding="30dp"
            android:text="Text here" />
        <TextView
            android:id="@+id/text4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/text3"
            android:padding="30dp"
            android:text="Text here" />

    </RelativeLayout>

矩形.xml

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:bottom="8dp" android:top="8dp" android:left="8dp" android:right="8dp">
    <shape >
        <stroke android:color="@android:color/black"
                android:width="1dip"/>
    </shape>
</item>

</layer-list>  


您可以添加图像吗?好,现在添加图像