0

I have a main Scrollview layout with a LinearLayout including several elements:

  • ExpandableListView #1 (1 children for yet)
  • TextView
  • ExpandableListView #2 (1 children for yet)
  • Several text views

The issue I encounter is when I click on any of the ExpandableListView, le display by itself is not expanding.

You can see the non-expanded view in this screen-capture (not clikced yet):

https://plus.google.com/photos/101037819512700772601/albums/5870915782494751761/5870915784486932322

You can see the should be expanded view (once I clicked on the ExpandableListViews) in this screen captures:

https://plus.google.com/photos/101037819512700772601/albums/5870915782494751761/5870915780856077570

There you have my layout:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="match_parent"
android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

            <ExpandableListView 
                android:id="@+id/expandableView" 
                android:layout_width="match_parent" 
                android:layout_height="match_parent">
            </ExpandableListView>

            <TextView
                android:id="@+id/providerNameView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_marginTop="2dp"
                android:text="ABCDEF1"
                android:textSize="25sp"
                android:textStyle="bold" />         

            <ExpandableListView
                android:id="@+id/expandableView2"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            </ExpandableListView>

            <TextView
                android:id="@+id/providerNameView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:layout_marginTop="2dp"
                android:text="ABCDEF2"
                android:textSize="25sp"
                android:textStyle="bold" />         

             . . . 

    </LinearLayout>     

</ScrollView>

Do you have a solution for my issue?

4

1 回答 1

0

第一件事。您不能嵌套多个垂直滚动视图。否则,您将有一个现场日试图覆盖适当的触摸事件以使一切正确。

如果您需要在列表滚动时滚动其他视图,您可以简单地添加页眉/页脚视图。如果你需要它是“粘性的”,那么粗略的谷歌搜索就会出现Sticky headers库。

于 2013-04-26T23:36:40.900 回答