1
我有一个导航抽屉有三个部分,顶部,中部和底部我需要使中间部分可以滚动。使Android导航抽屉可滚动
这是我目前的布局。
<?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/navigation_drawer_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start">
<!-- begin Top Section-->
<android.support.design.widget.NavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_black"
android:paddingLeft="50dp"
app:headerLayout="@layout/nav_header_main"
/>
<!--End Top Section-->
<!-- begin Middle Section-->
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer_top"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:background="@color/menuColor"
android:paddingLeft="50dp"
app:itemTextAppearance="@style/NavigationDrawerStyle"
app:menu="@menu/menu_navigation_drawer_top"
app:itemTextColor="@color/menuTextColour" />
<!-- End Middle Section-->
<!-- begin Bottom Section-->
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/background_black"
app:headerLayout="@layout/nav_group_line"
app:itemTextColor="@color/menuTextColour">
<android.support.design.widget.NavigationView
android:id="@+id/navigation_drawer_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/menuColor_bottom"
android:paddingLeft="50dp"
app:itemTextAppearance="@style/NavigationDrawerStyle"
app:itemTextColor="@color/menuTextColour"
app:menu="@menu/menu_navigation_drawer_bottom" />
</android.support.design.widget.NavigationView>
<!-- End Bottom Section-->
</android.support.design.widget.NavigationView>
我如何才能让染指部分scorll,能够在我的导航视图。
谢谢你。我已经尝试做它,但它没有成功。 –
@ NeranjaGunarathne我编辑了这个片段,请检查它,它为我工作。 – Shrikant