I want to create custom view as below.
---------- OR ---------
Line + 'Phrase' + Line
Which is a correct way to do it? Relative layout, Grid, or what? please advise
I want to create custom view as below.
---------- OR ---------
Line + 'Phrase' + Line
Which is a correct way to do it? Relative layout, Grid, or what? please advise
Use this for view.
This will adjust according to your screen width.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="3"
android:background="#D0D0D0" />
<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:layout_weight="1"
android:singleLine="true"
android:text="Your text goes here" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="3"
android:background="#D0D0D0" />
</LinearLayout>