如您所见,NavigationView已经设置了的背景android:clipToPadding='false',并且可以在透明下看到它NavigationBar。
但是NavigationView(NavigationDrawer)不能完全向上滚动到NavigationBar,如何解决呢?
我希望列表项滚动到的顶部NavigationBar,这意味着最后一个Send不是在下面,而是在上面NavigationBar。
layout / activity_main.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"
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"
android:clipToPadding="false"
android:clipChildren="false"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer">
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
好的,代码像这样运行,我无法搜索有用的答案。
任何想法都欢迎,谢谢!