小编San*_*eep的帖子

根据Android设备中的屏幕高度,使行的高度相等

我有三行,我希望修复这些行大小相等,它将基于我们给这个表整体的屏幕大小,意味着它将按照给定的高度平均划分三行,同样的做法对于列使用android:stretchColumns="0,1".表格结构如下:

<TableLayout android:layout_width="fill_parent" android:id="@+id/tabelViewButtons"
        android:layout_marginTop="10dip" android:layout_height="fill_parent"
        android:layout_below="@id/searchbar" android:layout_above="@id/follow_notification_bar"
        android:fitsSystemWindows="true" android:stretchColumns="0,1"
        >
    <TableRow >
        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_one"></ImageButton>
        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_two"></ImageButton>
    </TableRow>

    <TableRow >
        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_three"></ImageButton>

        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_four"></ImageButton>
    </TableRow>
    <TableRow >
        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_five"></ImageButton>
        <ImageButton android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:padding="5dip"
            android:id="@+id/button_six"></ImageButton>

    </TableRow>
    >

</TableLayout>
Run Code Online (Sandbox Code Playgroud)

android row

5
推荐指数
1
解决办法
5960
查看次数

拉伸行表布局Android

我想拉伸行等于设备屏幕,因为我们正在为Android设备中的表格布局中的列做.
请帮助我,并提前感谢您这样做.

android row

2
推荐指数
1
解决办法
9409
查看次数

标签 统计

android ×2

row ×2