滚动型内多个列表视图 [英] Multiple ListViews inside a ScrollView
本文介绍了滚动型内多个列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个复杂的XML文件,我真的需要一个滚动型。请不要介意的ID,因为我已经改变了他们。这里的滚动型不起作用。
<滚动型的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:fillViewport =真正的>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / f_summary_LL>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:背景=@彩色/黑白>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:layout_weight =1>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BT1
机器人:文字颜色=@色/白
机器人:TEXTSTYLE =黑体
机器人:重力=center_vertical |左
机器人:以下属性来=2DP
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BTS1
机器人:文字颜色=@色/白
机器人:以下属性来=4DP
机器人:TEXTSIZE =13SP/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:重力=center_vertical |右
机器人:layout_weight =1>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView7
机器人:TEXTSIZE =13SP
机器人:文字颜色=@色/白
机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BT1CRR机器人:文字颜色=@色/白
机器人:paddingRight =8DP机器人:TEXTSIZE =13SP
机器人:以下属性来=2DP/>
< / LinearLayout中>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / TextView的机器人:文字颜色=@色/白
机器人:layout_weight =3安卓重力=中心
机器人:背景=@可绘制/ table_header_cell_first
机器人:TEXTSTYLE =黑体
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=R
机器人:ID =@ + ID / textView1机器人:文字颜色=@色/白
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体机器人:layout_weight =1
/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=B
机器人:ID =@ + ID / textView2机器人:文字颜色=@色/白
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSTYLE =黑体的Android版本:TEXTSIZE =13SP
机器人:layout_weight =1/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=4S
机器人:ID =@ + ID / textView3机器人:文字颜色=@色/白
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体
机器人:layout_weight =1/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=6S
机器人:ID =@ + ID / textView4机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=SR
机器人:ID =@ + ID / textView5机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
>
<的ListView
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / ListView1的/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:背景=@彩色/黑白
机器人:baselineAligned =假>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:layout_weight =1
机器人:baselineAligned =假>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BT2机器人:TEXTSTYLE =黑体
机器人:文字颜色=@色/白
机器人:重力=center_vertical |左的Android版本:以下属性来=2DP
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BTS2机器人:TEXTSIZE =13SP
机器人:文字颜色=@色/白
机器人:以下属性来=4DP/>
< / LinearLayout中>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBH机器人:文字颜色=@色/白
机器人:layout_weight =3安卓重力=中心
机器人:背景=@可绘制/ table_header_cell_first
机器人:TEXTSIZE =13SP
机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=O
机器人:ID =@ + ID / textViewBOH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体机器人:可点击=假
/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=M
机器人:ID =@ + ID / textViewBMH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSTYLE =黑体的Android版本:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=R
机器人:ID =@ + ID / textViewBRH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=W
机器人:ID =@ + ID / textViewBWH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBECOH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心的Android版本:后台=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的ListView
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / listView2/>
< / LinearLayout中>
< / LinearLayout中>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:ID =@ + ID / innings2>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:背景=@彩色/黑白>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:layout_weight =1>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BT2机器人:TEXTSTYLE =黑体
机器人:文字颜色=@色/白
机器人:重力=center_vertical |左的Android版本:以下属性来=2DP
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BTS2机器人:TEXTSIZE =13SP
机器人:文字颜色=@色/白
机器人:以下属性来=4DP/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT机器人:layout_weight =1
机器人:重力=center_vertical |右>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView7机器人:TEXTSTYLE =黑体
机器人:文字颜色=@色/白
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=0.00
机器人:ID =@ + ID / Bae2C机器人:文字颜色=@色/白
机器人:以下属性来=2DP
机器人:paddingRight =8DP机器人:TEXTSIZE =13SP/>
< / LinearLayout中>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / TextView的机器人:文字颜色=@色/白
机器人:layout_weight =3安卓重力=中心
机器人:背景=@可绘制/ table_header_cell_first
机器人:TEXTSIZE =13SP
机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=R
机器人:ID =@ + ID / textView9机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体
机器人:可点击=假
/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView10机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSTYLE =黑体的Android版本:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView11机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView4机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textView5机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
>
<的ListView
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / listView3/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:背景=@彩色/黑白
机器人:baselineAligned =假>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT机器人:layout_weight =1
机器人:baselineAligned =假>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BW 1机器人:TEXTSTYLE =黑体
机器人:文字颜色=@色/白
机器人:重力=center_vertical |左的Android版本:以下属性来=2DP
机器人:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / BoSe1机器人:TEXTSIZE =13SP
机器人:文字颜色=@色/白
机器人:以下属性来=4DP/>
< / LinearLayout中>
< / LinearLayout中>
<的LinearLayout
机器人:方向=横向
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBH机器人:文字颜色=@色/白
机器人:layout_weight =3安卓重力=中心
机器人:背景=@可绘制/ table_header_cell_first
机器人:TEXTSIZE =13SP
机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBOH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体
机器人:可点击=假
/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBMH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSTYLE =黑体的Android版本:TEXTSIZE =13SP/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBRH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBWsH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
<的TextView
机器人:layout_width =0dp
机器人:layout_height =WRAP_CONTENT
机器人:文本=
机器人:ID =@ + ID / textViewBECOH机器人:文字颜色=@色/白
机器人:layout_weight =1
机器人:重力=中心
机器人:背景=@可绘制/ table_header_cell
机器人:TEXTSIZE =13SP机器人:TEXTSTYLE =黑体/>
< / LinearLayout中>
<的LinearLayout
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
>
<的ListView
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / listView4/>
< / LinearLayout中>
< / LinearLayout中>
< / LinearLayout中>
< /滚动型>
解决方案
这是可以做到,但你不应该把一个列表视图滚动视图内,但有时这是更简单的方法:的 http://stackoverflow.com/a/3495908/1117338
I have a complex xml file and I really need a ScrollView. Please Don't mind the Ids as I have changed them. The ScrollView here doesn't work.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/f_summary_LL">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BT1"
android:textColor="@color/white"
android:textStyle="bold"
android:gravity="center_vertical|left"
android:paddingLeft="2dp"
android:textSize="13sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BTS1"
android:textColor="@color/white"
android:paddingLeft="4dp"
android:textSize="13sp"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|right"
android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView7"
android:textSize="13sp"
android:textColor="@color/white"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BT1CRR" android:textColor="@color/white"
android:paddingRight="8dp" android:textSize="13sp"
android:paddingLeft="2dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView" android:textColor="@color/white"
android:layout_weight="3" android:gravity="center"
android:background="@drawable/table_header_cell_first"
android:textStyle="bold"
android:textSize="13sp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="R"
android:id="@+id/textView1" android:textColor="@color/white"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold" android:layout_weight="1"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="B"
android:id="@+id/textView2" android:textColor="@color/white"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textStyle="bold" android:textSize="13sp"
android:layout_weight="1"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="4s"
android:id="@+id/textView3" android:textColor="@color/white"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"
android:layout_weight="1"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="6s"
android:id="@+id/textView4" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="SR"
android:id="@+id/textView5" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
android:baselineAligned="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BT2" android:textStyle="bold"
android:textColor="@color/white"
android:gravity="center_vertical|left" android:paddingLeft="2dp"
android:textSize="13sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BTS2" android:textSize="13sp"
android:textColor="@color/white"
android:paddingLeft="4dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBH" android:textColor="@color/white"
android:layout_weight="3" android:gravity="center"
android:background="@drawable/table_header_cell_first"
android:textSize="13sp"
android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="O"
android:id="@+id/textViewBOH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold" android:clickable="false"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="M"
android:id="@+id/textViewBMH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textStyle="bold" android:textSize="13sp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="R"
android:id="@+id/textViewBRH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="W"
android:id="@+id/textViewBWH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBECOH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center" android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView2"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/innings2">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BT2" android:textStyle="bold"
android:textColor="@color/white"
android:gravity="center_vertical|left" android:paddingLeft="2dp"
android:textSize="13sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BTS2" android:textSize="13sp"
android:textColor="@color/white"
android:paddingLeft="4dp"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1"
android:gravity="center_vertical|right">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView7" android:textStyle="bold"
android:textColor="@color/white"
android:textSize="13sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.00"
android:id="@+id/Bae2C" android:textColor="@color/white"
android:paddingLeft="2dp"
android:paddingRight="8dp" android:textSize="13sp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView" android:textColor="@color/white"
android:layout_weight="3" android:gravity="center"
android:background="@drawable/table_header_cell_first"
android:textSize="13sp"
android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="R"
android:id="@+id/textView9" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"
android:clickable="false"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView10" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textStyle="bold" android:textSize="13sp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView11" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView4" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textView5" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView3"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
android:baselineAligned="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/Bw1" android:textStyle="bold"
android:textColor="@color/white"
android:gravity="center_vertical|left" android:paddingLeft="2dp"
android:textSize="13sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/BoSe1" android:textSize="13sp"
android:textColor="@color/white"
android:paddingLeft="4dp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBH" android:textColor="@color/white"
android:layout_weight="3" android:gravity="center"
android:background="@drawable/table_header_cell_first"
android:textSize="13sp"
android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBOH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"
android:clickable="false"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBMH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textStyle="bold" android:textSize="13sp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBRH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBWsH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text=""
android:id="@+id/textViewBECOH" android:textColor="@color/white"
android:layout_weight="1"
android:gravity="center"
android:background="@drawable/table_header_cell"
android:textSize="13sp" android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView4"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
解决方案
It can be done, although you should not put a listview inside a scrollview but sometimes this is the easier way: http://stackoverflow.com/a/3495908/1117338
这篇关于滚动型内多个列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文