Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add space between two textviews

I am new to android development and I was just wondering how can I add space between two TextViews? Any help would be appreciated.

The code I have written so far

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/lbl_group_coworkers"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Coworkers" />

    <TextView 
        android:id="@id/lbl_group_"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Family"/>



</LinearLayout>
like image 370
Anmol Wadhwa Avatar asked Sep 11 '13 11:09

Anmol Wadhwa


1 Answers

You can use android:layout_marginTop="value" like this

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/lbl_group_coworkers"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Coworkers" />

        <TextView 
            android:id="@id/lbl_group_"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:text="Family"/>
    </LinearLayout>
like image 148
Ali Ahmad Avatar answered Sep 17 '22 19:09

Ali Ahmad