【发布时间】:2012-05-10 13:32:02
【问题描述】:
我想创建一个包含 3 个列表和 3 个标题的页面,但我不想单独滚动它们,我希望整个页面都滚动。有谁知道我如何做到这一点?
基本上我希望它看起来像这样:
header
smlheader
list
smlheader
list
smlheader
list
通过这段代码,我尝试过实现它,但效果并不好。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white">
<include layout="@layout/header" />
<include layout="@layout/redcell" />
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="60dp" >
<TextView
android:id="@+id/fixtures_text"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center"
android:text="@string/leagues"
android:textColor="@color/white"
android:textSize="25dp"
android:textStyle="bold"/>
</TableRow>
<include layout="@layout/redcell" />
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="60dp" >
<TextView
android:id="@+id/results_text"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center"
android:text="@string/leagues"
android:textColor="@color/white"
android:textSize="25dp"
android:textStyle="bold"/>
</TableRow>
<include layout="@layout/redcell" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</TableLayout>
<ScrollView/>
【问题讨论】:
-
我不清楚你想要什么...你想要三个并排滚动在一起的列表,还是三个垂直排列但作为一个列表滚动的列表?
-
你试过什么?如果没有看到您使用的代码,我们将无能为力。
-
三个垂直排列的列表作为一个列表滚动
-
我也编辑了我的问题,以展示我迄今为止尝试过的内容,我试图通过表格行来实现它