开发者

Android: How to make scrollable table with frozen table headers?

I wonder how I could make a scrollable table with static table header ? (with different 开发者_高级运维elements in cells like buttons, images, etc.)

I have already made some of this, but i dont know how to make columns in different tables match each other by width.

<TableLayout>
    <TableRow>
        Table headers...
    </TableRow>
    <ScrollView>
        <TableLayout > <!-- Table content--></TableLayout >
    </ScrollView>
</TableLayout>

Thanks !


You should ditch the TableLayout for a ListView or GridView Then use a RelativeLayout

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="wrap_parent"
    android:laout_height="wrap_content"
    android:alignParentTop="true"
    android:id="@+id/buttons">
 <!-- Your Buttons Here -->
 </LinearLayout>
 <GridView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@id/buttons"/>
 </RelativeLayout>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜