Задать ширину столбцов в таблице

Таблица из 5 столбцов, но всего три значения, последние два занимают по два объединённых столбца.

введите сюда описание изображения

Нужно сделать так, чтоб при масштабировании (изменении размера шрифта), соотношение ширины так и оставалось 1-2-2. Когда я, прямо в редакторе, делаю автозамену шрифта с 12 на 32, получается так:

введите сюда описание изображения

Как бороться? Итоговая таблица очень длинная, поэтому это всё внутри ScrollView

test.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="3dp"
    android:background="#fff">

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#000"
            android:stretchColumns="*">

            <TableRow>
                <TextView
                    android:layout_margin="1px"
                    android:layout_span="5"
                    android:background="#fff"
                    android:gravity="center_horizontal"
                    android:text="Строка на 5 столбцов"
                    android:textColor="#000"
                    android:textSize="15dp" />
            </TableRow>

            <TableRow>
                <TextView
                    android:id="@+id/c12"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="1"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="1"
                    android:textColor="#000"
                    android:textSize="12dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/d12"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="2"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="2"
                    android:textColor="#000"
                    android:textSize="12dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/e12"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="2"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="2"
                    android:textColor="#000"
                    android:textSize="12dp"
                    android:textStyle="bold" />
            </TableRow>

            <TableRow>
                <TextView
                    android:id="@+id/c13"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="1"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="Строка"
                    android:textColor="#000"
                    android:textSize="12dp" />

                <TextView
                    android:id="@+id/d13"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="2"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="Длинная строка"
                    android:textColor="#000"
                    android:textSize="12dp" />

                <TextView
                    android:id="@+id/e13"
                    android:layout_height="match_parent"
                    android:layout_margin="1px"
                    android:layout_span="2"
                    android:background="#D8E4BC"
                    android:gravity="center_horizontal"
                    android:text="Длинная строка"
                    android:textColor="#000"
                    android:textSize="12dp" />
            </TableRow>
        </TableLayout>
    </ScrollView>
</RelativeLayout>

Ответы (1 шт):

Автор решения: DrMcSheen

Сделай 10 столбцов и 2-4-4 и будет тебе счастье.

→ Ссылка