DonnieHe
DonnieHe

Reputation: 23

In the top of NavigationView has shadow,How can I remove it?

Layout image

I am sorry about that my English is horrible,thanks for your help!

This code is my fragments layout.

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:openDrawer="end">
    <com.wk.reservation.view.PullListView
        android:id="@id/listView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view_right"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        app:itemBackground="@android:color/white">

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

    </android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>`

Upvotes: 1

Views: 702

Answers (2)

Carl Rocamora
Carl Rocamora

Reputation: 81

Maybe it's already too late to answer this but for the version

'com.android.support:design:25.3.1'

you can try adding

app:insetForeground="@android:color/transparent"

So navigation view would look like this

<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:layout_marginTop="?attr/actionBarSize"
                android:background="@color/colorPrimary"
                app:elevation="0dp"
                app:insetForeground="@android:color/transparent"
                app:itemIconTint="@color/white"
                app:itemTextColor="@color/white"
                app:menu="@menu/main_drawer">

Upvotes: 5

Fabio Venturi Pastor
Fabio Venturi Pastor

Reputation: 2529

I got the same bug, when i upgrade the android libraries to the 23.2.0 that shadow appears in my projects, so the only way i found to resolve the bug is downgrade the libraries version to 23.1.1:

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'

Upvotes: 0

Related Questions