【问题标题】:How to make motionless table header row?如何制作静止的表格标题行?
【发布时间】:2012-01-05 14:22:48
【问题描述】:

此代码有效,但我需要调整标题字段和剩余表格的大小。如何调整列的大小?

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/table_hsv"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <TableLayout
        android:id="@+id/table_header"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:stretchColumns="1" >
        <TableRow
            android:id="@+id/table_header_row"
            android:background="@color/listcolor" >
        </TableRow>
        <ScrollView
            android:id="@+id/table_sv"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >
            <TableLayout
                android:id="@+id/table_data"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:stretchColumns="1" >
            </TableLayout>
        </ScrollView>
    </TableLayout>
</HorizontalScrollView>

谢谢

【问题讨论】:

  • 我不确定您想做什么,以及您目前拥有什么。您能给我们提供更多信息吗?
  • 我需要显示表格,标题应该是固定的。标题的宽度应与数据的字段宽度一致。
  • 很抱歉,我找到了问题的解决方案。 github.com/StylingAndroid/ScrollingTable

标签: android android-layout tablelayout


【解决方案1】:

对不起,我找到了问题的解决方案。 https://github.com/StylingAndroid/ScrollingTable

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-25
    • 1970-01-01
    • 2016-04-20
    • 1970-01-01
    • 2013-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多