question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomNavigationView] Weird background using Material 1.1.0 and Navigation component

See original GitHub issue

I am using some BottomNavigationViews with transparent background in my app and It was working really well but I had to add budgets to my BNV so I added com.google.android.material:material:1.1.0 stable version

Now my BNV has some weird shadow/background behind and it looks really bad and it’s happening everywhere.

asd

asd2

This is on emulator but on a real device is even worst. It has trapeze form.

I am using:

minSdkVersion 26

targetSdkVersion 29

navigation_version 2.2.0

material_version 1.1.0

And my BNV is:

                android:id="@+id/topNavigationView"
                style="@style/SearchBottomMenu"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="#00000000"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/autoTv"
                app:menu="@menu/search_nav_menu" />

This is the style:

    <style name="SearchBottomMenu">
        <item name="itemIconTint">@drawable/nav_item_color_state_dark</item>
        <item name="itemTextColor">@drawable/nav_item_color_state_dark</item>
        <item name="android:paddingTop">@dimen/padding_nano</item>
    </style>

and this is the menu

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/trendingSearchFragment"
        android:icon="@drawable/ic_trending"
        android:title="Tendencias" />
    <item
        android:id="@+id/mySearchesFragment"
        android:icon="@drawable/ic_my_preferences"
        android:title="Favoritos" />
    <item
        android:id="@+id/favoriteSearchFragment"
        android:icon="@drawable/ic_my_search"
        android:title="Mis busquedas" />
</menu>

if I remove android material 1.1.0 and not excluding material 1.0.0 from navigation component it just looks perfect.

asd3

Thanks for any help.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
ghostcommented, Apr 14, 2020

The point was app:elevation="0dp". Not android:elevation="0dp"

7reactions
hunterstichcommented, Apr 13, 2020

Yea, what you’re seeing is the shadow behind your transparent BottomNavigationView. If you set app:elevation="0dp" on your BottomNavigationView, you should get what you’re looking for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - BottomNavigationView inside a BottomAppBar with ...
The workaround is to set a background in the xml which is neither null or a ColorDrawable. I created my own drawable, which...
Read more >
How to Customize Background Shape Bottom Navigation ...
CustomShape # BottomNavigationView #AndroidStudio #Modern Hi everyone, I am @Abdul Aziz Ahwan . In this video, we are going to Learn How do...
Read more >
Bottom Navigation View Using Jetpack Navigation Component
... video we will learn to implement a bottom navigation view with jetpack navigation component. Bottom Navigation View is a material comp...
Read more >
Hands-on with Material Components for Android: Bottom ...
The Bottom Navigation bar is a top-level navigation component. It displays three to five destinations, each with an icon and an optional text...
Read more >
No Materialcardview Background In Darkview - ADocLib
For some time the bottom navigation view missed some crucial features mostly related to menuItemId menuItemId { return mainScreen } } return null...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found