列表视图不与可扩展列表视图一起滚动

时间:2016-07-18 09:37:36

标签: android xml listview expandablelistview

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        android:clickable="true">

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

    <ExpandableListView
        android:id="@+id/exp_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="160dp"
        android:indicatorRight="?android:attr/expandableListPreferredItemIndicatorRight"
        android:background="@android:color/white"
        android:footerDividersEnabled="true"
        android:groupIndicator="@null">
    </ExpandableListView>
            <ListView
                android:background="@android:color/white"
                android:id="@+id/menuList"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="10dp" />
        </LinearLayout>
    </android.support.design.widget.NavigationView>

</android.support.v4.widget.DrawerLayout>

我已经实现了一个Expandable ListView和一个List View.But当我滚动我的View时,Expandable ListView可以单独滚动,ListView可以单独滚动。简单的ListView不会与Expandable ListView一起滚动。我想要我的ListView还应该与Expandable ListView一起滚动。这是我对上述代码的设计。

my design screenshot

0 个答案:

没有答案