Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: remove shadow from bottom navigation

When placing a container below my bottom navigation, it is partly covered by the gray shadow from the navigation, even after adding content to the container. How do I remove the shadow? screenshot

like image 580
tmbz Avatar asked Sep 25 '17 12:09

tmbz


People also ask

How do I hide the bottom of my navigation?

Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.

How do I change the bottom navigation on Android?

Step 4: Creating a menu for the Bottom Navigation Bar The Navigation Bar needs to have some items which will create using Menu. To create a Menu, first, create a Menu Directory by clicking on the app -> res(right-click) -> New -> Android Resource Directory and select Menu in the Resource Type.


2 Answers

Use app:elevation="0dp" to hide shadow from from bottom navigation

<android.support.design.widget.BottomNavigationView
    android:id="@+id/bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@android:color/white"
    app:elevation="0dp"
    app:menu="@menu/bottom_navigation_main" />
like image 96
AskNilesh Avatar answered Sep 28 '22 04:09

AskNilesh


If you are using above Api-level 28 you can use

android:outlineAmbientShadowColor="@android:color/transparent"
android:outlineSpotShadowColor="@android:color/transparent"
like image 41
William Avatar answered Sep 28 '22 03:09

William