在layout 中的listView后面不能显示任何子类,listview是填充这个现象的。它能滚动,但是不能显示其它的子类。
我想使用ScrollView,但是expandlist有问题。
layout xml 代码:
android:background="@drawable/header_bg"
android:gravity="center"
android:paddingRight="50dip"
android:paddingTop="5dip"
android:text="@string/select"
android:textColor="#60240a"
android:textSize="18dip"
android:textStyle="bold" >
</TextView>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="@android:color/transparent"
android:divider="@drawable/line_divider"
android:dividerHeight="3dip"
android:listSelector="@android:color/transparent" >
</ListView>
<ImageView
android:layout_width="fill_parent"
android:layout_height="3dip"
android:src="@drawable/line_divider" />
<ExpandableListView
android:id="@+id/expandableList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="@android:color/transparent"
android:childDivider="@drawable/line_divider"
android:divider="@drawable/line_divider"
android:dividerHeight="2dip"
android:listSelector="@android:color/transparent"
android:textColor="#60240a" >
</ExpandableListView>
</LinearLayout>
看起来像是你在布局中使用了ListView和ExpandableListView,而且ExpandableListView放在ListView后面,但是由于ListView是填充整个父布局,所以ExpandableListView无法显示。你可以尝试将ExpandableListView放在ListView前面或者使用ScrollView包裹ListView和ExpandableListView来解决这个问题。