Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try something like this:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/interest_rate_label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="%" /&gt; &lt;EditText android:id="@+id/interest_rate_edit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Interest Rate..." /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/sales_tax_label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Interest Rate %" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout&gt; </code></pre> <p>I'll test it when I get home, I think that will work though. Basically, just put two separate LinearLayouts within a LinearLayout, each weighted to 1 (so they are of equal width), then place your views within these LinearLayouts. You may also want to add some padding to the LinearLayouts as well.</p> <p>EDIT: Try this way with a TableLayout. It's not perfect, but it'll get you there!</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1|2" &gt; &lt;TableRow android:layout_height="wrap_content" android:weightSum="2" android:layout_margin="5dp" &gt; &lt;EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:layout_weight="1" android:paddingRight="5dp" android:gravity="right|center_vertical" android:hint="percent" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:layout_weight="1" android:paddingLeft="5dp" android:textStyle="bold" android:textSize="16sp" android:textColor="@android:color/white" android:text="Interest Rate" /&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_height="wrap_content" android:weightSum="2" android:layout_margin="5dp" &gt; &lt;EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:layout_weight="1" android:paddingRight="5dp" android:gravity="right|center_vertical" android:hint="months" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" android:layout_weight="1" android:paddingLeft="5dp" android:textStyle="bold" android:textSize="16sp" android:textColor="@android:color/white" android:text="Loan Term" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload