2015-08-29 56 views
1

我使用NavigationView和compile 'com.android.support:design:22.2.1' 那麼,除非沒有垂直滾動,否則一切都很好 如何通過xml設置它?Android - Material Design - NavigationView - 如何放置垂直滾動?

XML:

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

    <!-- The main content view --> 
    <foo> 
    </foo> 

    <!-- The navigation drawer --> 
    <android.support.design.widget.NavigationView 
     android:id="@+id/navigation_view" 
     style="@style/NavigationViewTheme" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:fitsSystemWindows="true" 
     app:headerLayout="@layout/navigation_drawer_header" 
     app:menu="@menu/navigation_drawer_menu" /> 
</android.support.v4.widget.DrawerLayout> 
+0

我相信這是不可能的。 – natario

+0

Gmail和其他應用程序在菜單抽屜中有垂直滾動 –

+0

也許他們沒有使用NavigationView,這是相當新的 – natario

回答

1

我找到了一個解決方案,這似乎是在設計庫中的缺陷。更新庫解決了我的問題

compile 'com.android.support:design:23.0.1' 
0

嘗試android:nestedScrollingEnabled="true"android.support.design.widget.NavigationView

+0

什麼都沒有發生,是否缺少其他任何東西? –

+0

@DouglasFornaro嘗試將您的菜單放在滾動視圖中 –