Android 如何向线性布局添加标题

Android 如何向线性布局添加标题,android,border,Android,Border,我必须创建一个如下所示的GUI。我使用了LinearLayout并在其周围创建了边框。我必须在边框之间插入标题文本。你知道怎么做吗。) <RelativeLayout>) <LinearLayout with border> <TextView with white background> </RelativeLayout> 文本视图应该出现在用白色背景覆盖边框的线性布局上方。您可以使用边距进行定位。使用RelativeLayo

我必须创建一个如下所示的GUI。我使用了LinearLayout并在其周围创建了边框。我必须在边框之间插入标题文本。你知道怎么做吗。

<RelativeLayout>)
    <LinearLayout with border>
    <TextView with white background>
</RelativeLayout>

文本视图应该出现在用白色背景覆盖边框的线性布局上方。您可以使用边距进行定位。

使用RelativeLayout重叠行,但不能在Linearlayout上进行重叠。

使用relative layout作为父项,并将所有Linearlayout代码置于relative layout下。然后在相对布局中添加textview,并提到textview位于顶部,并给出marign

  <RelativeLayout>
     <TextView android:layout_alignParentTop="true"
      android:layout_margin="20dip/>
     <LinearLayout>
                // here is your linear layout
     </LinearLayout>
   </RelativeLayout>