How do I split a TableRow evenly between both columns?
<p>I am generating TableRows dynamically. For each TableRow, there is a TextView in one column and an EditText in the other. How do I generate the rows such that the TextView takes up half the row and the EditText the other half?</p>

<p>This is what I currently have:</p>

<p>The layout xml file</p>

<pre><code>&lt;TableLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:stretchColumns="*"
        android:id="@+id/formTable" /&gt;
</code></pre>

<p>The Java source file</p>

<pre><code>private TreeMap&lt;String, EditText&gt; textData;
...
protected void onCreate(Bundle savedInstanceState) {
    ...
    textData = populateMap();
    ...
    TableLayout table = (TableLayout) findViewById(R.id.formTable);
    configureTableLayout(table,textData);
}

private TreeMap&lt;String, EditText&gt; populateMap() {
    TreeMap&lt;String, EditText&gt; map = new TreeMap&lt;String, EditText&gt;();

    Set&lt;String&gt; dataTypeSet = app.getWorkingDataTypeList();
    for (String dataTypeKey : dataTypeSet) {
        EditText edit = new EditText(this);
        edit.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        edit.setText("0");
        edit.setHorizontallyScrolling(true);
        map.put(dataTypeKey, edit);
    }

    return map;
}

private void configureTableLayout (TableLayout table, 
        Map&lt;String, ? extends View&gt; input) {
    for (Map.Entry&lt;String, ? extends View&gt; entry : input.entrySet()) {
        addTableRow(table, entry.getKey(), entry.getValue());
    }
}

private void addTableRow(TableLayout table, String dataTypeKey, View v) {
    TableRow row = new TableRow(this);
    row.setLayoutParams(new TableRow.LayoutParams(
            TableRow.LayoutParams.FILL_PARENT,
            TableRow.LayoutParams.WRAP_CONTENT));

    TextView textCol = new TextView(this); // left column
    textCol.setText(app.getTypeNameForKey(dataTypeKey));
    textCol.setLayoutParams(new TableRow.LayoutParams(
            TableRow.LayoutParams.FILL_PARENT,
            TableRow.LayoutParams.FILL_PARENT));
    textCol.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
    textCol.setHorizontallyScrolling(true);

    // right column
    TableRow.LayoutParams params = new TableRow.LayoutParams(
            TableRow.LayoutParams.FILL_PARENT,
            TableRow.LayoutParams.WRAP_CONTENT);
    params.column = 1;
    v.setLayoutParams(params);

    row.addView(textCol);
    row.addView(v);

    table.addView(row);
}
</code></pre>

<p>I have read <a href="http://stackoverflow.com/questions/1666685/android-stretch-columns-evenly-in-a-tablelayout">this post</a> already, but it's not exactly what I'm looking for. My primary motivation for splitting each row evenly is that if one of the Strings resulting from <code>app.getTypeNameForKey(dataTypeKey)</code> (found in <code>addTableRow()</code>) is excessively long, it might cause the EditText column to become too small for readability.</p>
