2016-05-30 12 views
0

ナビゲーションドロワーを使用してアプリを構築しています。ナビゲーションlistviewと展開可能なリストビューがスクロールしていないドロワー

  1. ナビゲーションドロワには2つのリストビューと1つの展開可能なリストビューがあります。

  2. ナビゲーション・ドロワー全体をスクロールしたいと考えています。

私のxmlファイル

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

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


     <android.support.v7.widget.Toolbar 
      android:id="@+id/drawer_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="?attr/colorPrimaryDark" 
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> 


     <FrameLayout 
      android:id="@+id/frame_layout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
     </FrameLayout> 
    </LinearLayout> 


    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:background="@color/white" 
     android:elevation="16dp" 
     android:orientation="vertical"> 

     <include layout="@layout/navigation_header" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="8dp" 
      android:padding="10dp" 
      android:text="@string/popular_categories" 
      android:textColor="@color/grey" 
      android:textSize="20sp" /> 

     <ListView 
      android:id="@+id/popular_categories_list" 
      android:layout_width="match_parent" 
      android:divider="@null" 
      android:nestedScrollingEnabled="false" 
      android:layout_height="wrap_content"> 

     </ListView> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="1dp" 
      android:background="?android:attr/listDivider" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="8dp" 
      android:padding="10dp" 
      android:text="@string/all_categories" 
      android:textColor="@color/grey" 
      android:textSize="20sp" /> 

     <ExpandableListView 

      android:id="@+id/expandable_listView" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:childDivider="@color/white" 
      android:divider="@null" 
      android:groupIndicator="@drawable/group_indicator" 
      android:indicatorEnd="285dp" 
      android:indicatorStart="250dp" 
      android:paddingBottom="8dp" 
      android:paddingTop="8dp" 
      android:scrollbars="none" /> 

     <View 
      android:layout_width="match_parent" 
      android:layout_height="1dp" 
      android:background="?android:attr/listDivider" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="8dp" 
      android:padding="10dp" 
      android:text="@string/others" 
      android:textColor="@color/grey" 
      android:textSize="20sp" /> 

     <ListView 
      android:id="@+id/other_list" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

     </ListView> 

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

リストビュー自体スクロールしません。下のビューは隠れたままです。

私はflipkartアプリに似た引き出しを実装したいと思います。

ありがとうございます。

答えて

0

次のようにレイアウトを設計します。 複数のリストビューと展開可能なリストビューは必要ありません。単一の展開可能なリストビューで処理できます。

<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"> 

    <android.support.design.widget.CoordinatorLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     tools:context=".activity.HomeActivity"> 

     <android.support.design.widget.AppBarLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:theme="@style/AppTheme.AppBarOverlay"> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       android:background="@color/actionbar" 
       app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     </android.support.design.widget.AppBarLayout> 

     <RelativeLayout 
      android:id="@+id/commoncontainer" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_behavior="@string/appbar_scrolling_view_behavior" 
      tools:showIn="@layout/app_bar_main"></RelativeLayout> 


    </android.support.design.widget.CoordinatorLayout> 

    <ExpandableListView 
     android:id="@+id/lvExp" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:background="@drawable/sidebar_bg" 
     android:cacheColorHint="@color/transparent" 
     android:choiceMode="singleChoice" 
     android:clickable="false" 
     android:divider="@null" 
     android:groupIndicator="@null" 
     android:listSelector="@android:color/transparent" 
     android:scrollbars="none"></ExpandableListView> 

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

が、私のアプリのレイアウトは、複数のリストビューあなたは1つのレイアウトにすぎスクロールアイテムをどのように管理するかを –

+0

を要求していることなどありますか? –

+0

私は知らないのを恐れています。しかし、私はそれをflipkartアプリにあるようにしたい! –

関連する問題