Home > Blockchain >  Invisible background in BottomNavigationBar
Invisible background in BottomNavigationBar

Time:04-01

I want to set the background transparent, but I've tried everything and I can't set it. I let my XML code and a pic of the cell here:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MenuPrincipalActivity" >

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:id="@ id/frame_layout"/>

    <com.etebarian.meowbottomnavigation.MeowBottomNavigation
        android:id="@ id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mbn_backgroundBottomColor="#FFFFFF"
        app:mbn_circleColor="@color/whiteTextColor"
        app:mbn_countBackgroundColor="#ff6f00"
        app:mbn_countTextColor="@color/whiteTextColor"
        app:mbn_defaultIconColor="@color/black"
        app:mbn_selectedIconColor="@color/black"
        android:background="@null"/>

</LinearLayout>

If you see the photo, you can see that the background isn't background. In the XML, if I change the background color of BottomNavigationBar it changes, but I really tried with everything, but I'm not able to set the transparent background.

CodePudding user response:

You're using a MeowBottomNavigation, with quick search, you can see here, that someone already ask for the same thing #21

So try this :

android:background="@android:color/transparent"

CodePudding user response:

Instead of setting the background to a transparent color, create a transparent Rectangle drawable like:

drawable\transparent_rect.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <solid android:color="#00000000" />
</shape>

Then set that to android:background

<com.etebarian.meowbottomnavigation.MeowBottomNavigation
    ...
    android:background="@drawable/transparent_rect"/>
  • Related