How to add a title to a linear layout

I need to create a GUI as shown below. I used LinearLayout and created a border around it. I need to insert a caption text between the frame. Any idea how to do this.enter image description here

+5
source share
3 answers
<RelativeLayout>)
    <LinearLayout with border>
    <TextView with white background>
</RelativeLayout>

A TextView should appear above the line covering the border with its white background. You can position it using fields.

+3
source

use the relative layout as the parent and put all your linearlayout code under the relative layout. Then add a textview to the relative layout and note that the textview is on top and give marign.

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

RelativeLayout , Linringayout

0

All Articles