我需要创建一个如下所示的GUI界面。我已经使用LinearLayout并创建了周围的边框。我需要在边框之间插入标题文本。有什么好的方法可以实现吗?
<RelativeLayout>)
<LinearLayout with border>
<TextView with white background>
</RelativeLayout>
TextView 应该出现在覆盖边框的 LinearLayout 上方,带有它的白色背景。你可以使用边距来定位它。
使用相对布局作为父布局,并将所有线性布局代码放在相对布局下面。然后在相对布局中添加TextView,并指定该TextView位于顶部并给予边距。
<RelativeLayout>
<TextView android:layout_alignParentTop="true"
android:layout_margin="20dip/>
<LinearLayout>
// here is your linear layout
</LinearLayout>
</RelativeLayout>