Aligning elements inside a LinearLayout taking half screen space
<p>I have four elements inside a linear layout. </p>

<p>I want to align them in such a way that <code>classALabel</code> &amp; <code>classBLabel</code> are aligned right next to each other side by side taking half-half width of the screen.</p>

<p>And <code>classA</code> &amp; <code>classB</code> also aligned right next to each other side by side taking half-half width of the screen BUT below <code>classALabel</code> &amp; <code>classBLabel</code>.</p>

<p>Below is what I have tried so far, but this isn’t working as I want. It is just showing all four elements side by side giving each 25% of screen space.</p>

<pre><code>&lt;LinearLayout
    android:id="@+id/ClassALayout"
    android:layout_width="match_parent"
    android:layout_height="@dimen/tile_height"
    android:layout_below="@+id/ClassLayout"
    android:layout_marginBottom="8dp"
    android:layout_marginTop="8dp"
    android:orientation="horizontal"&gt;

    &lt;TextView
        android:id="@+id/classALabel"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="@string/classALabel" /&gt;

    &lt;TextView
        android:id="@+id/classA"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/classALabel"
        android:layout_marginTop="@dimen/dimen_2"
        android:layout_alignParentLeft="true"
        android:layout_weight="1"
/&gt;

    &lt;TextView
        android:id="@+id/classBLabel"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/classA"
        android:layout_weight="1"
        android:text="@string/classBLabel" /&gt;

    &lt;TextView
        android:id="@+id/classB"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/classBLabel"
        android:layout_marginTop="@dimen/dimen_2"
        android:layout_weight="1"
 /&gt;
&lt;/LinearLayout&gt;
</code></pre>