Android-材质设计-NavigationView-如何放置垂直滚动? [英] Android - Material Design - NavigationView - How to put vertical scroll?

查看:195
本文介绍了Android-材质设计-NavigationView-如何放置垂直滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将NavigationView与compile 'com.android.support:design:22.2.1'一起使用 好吧,除非没有垂直滚动,否则一切都很好 如何通过xml设置它?

i'm using NavigationView with compile 'com.android.support:design:22.2.1' Well, everything is good unless it hasn't vertical scroll How do I set it via xml?

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>

推荐答案

我找到了解决方案,这似乎是设计库中的错误.更新图书馆解决了我的问题

I found a solution for this, it seems to be a bug on design library. Updating the library solved my problem

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

这篇关于Android-材质设计-NavigationView-如何放置垂直滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆