BottomBar icon indicating copy to clipboard operation
BottomBar copied to clipboard

Empty Space above bar

Open DevJCrystal opened this issue 10 years ago • 16 comments

weirdbar

There is an empty space above the bar, I am sorry if I missed something. I searched some of the open and closed tickets and didn't see anything.

I have tried attaching using mBottomBar = BottomBar.attach(this, savedInstanceState); and mBottomBar = BottomBar.attach(findViewById(R.id.myCoordinator), savedInstanceState); but it still happens.

Tested on Nexus 6p running N and Nexus 7 running 6.0.1

Thanks,

Jake

DevJCrystal avatar Apr 01 '16 18:04 DevJCrystal

Same issue here running 4.4.4 and 5.1.1, so not just an Android 6 problem.

Nolanus avatar Apr 02 '16 20:04 Nolanus

It appears to be a bug, it happens when you add to your main activity resource file: fitsSystemWindows = true. I removed that and added manually some top padding to my custom toolbar. It fixes this issue for now.

cyberjaime45 avatar Apr 04 '16 00:04 cyberjaime45

How does your XML layout structure look like?

roughike avatar Apr 05 '16 12:04 roughike

My main layout:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main_coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <FrameLayout
        android:id="@+id/activity_main_content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.AppBarLayout
        android:id="@+id/activity_main_app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/activity_main_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_scrollFlags="scroll|enterAlways|snap">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/app_name" />
        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TabLayout
            android:id="@+id/activity_main_tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            android:visibility="gone" />
    </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>

Inside the fragments that are put "into" R.id.activity_main_content_frame there are e.g. a ViewPager (with fragments again and inside these fragments RecyclerViews) or RecyclerViews.

Nolanus avatar Apr 05 '16 12:04 Nolanus

This is my XML for my main activity:

<include
    android:id="@+id/main_activity_toolbar"
    layout="@layout/tool_bar" />

<FrameLayout
    android:id="@+id/mainFragmentContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/main_activity_toolbar">
</FrameLayout>

cyberjaime45 avatar Apr 06 '16 01:04 cyberjaime45

@cyberjaime45 Try attaching the BottomBar to your mainFragmentContainer.

roughike avatar Apr 06 '16 11:04 roughike

Awesome library, its working well for me. Sure I had some issues but nothing I can't handle it.

cyberjaime45 avatar Apr 06 '16 12:04 cyberjaime45

try fitsSystemWindows="false" on everything including the tablayout and framelayout

behelit avatar Apr 16 '16 02:04 behelit

I have the same problem if I set fitSystemWindows="true" I got a extra space above the bottomBar and if I set to false I got my toolbar behind the status bar

For now I defined a paddinBottom="24dp" in my Toolbar but I think that is not a good ideia

Has anyone solved this problem?

vemfaru avatar Jul 13 '16 03:07 vemfaru

This is fixed in the newest versions.

roughike avatar Aug 21 '16 08:08 roughike

I have also having same problem. As per my functionality I need to use drawer menu as well as bottom navigation. If I use bottom navigation with only 3 tabs than it works fine but if I extend bottom navigation with 4 or 5 tabs than it appears white space at the top of tool bar. screen2 screen1

DarshanTrivedi avatar Sep 29 '16 10:09 DarshanTrivedi

Hello! I have the bottom bar inside a LinearLayout with two children.

<FrameLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:background="@color/colorAccent"
    tools:fragment="us.kostenko.glagol.QuizActivity">
</FrameLayout>

<com.roughike.bottombar.BottomBar
    android:id="@+id/bottomBar"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:background="@color/colorBottomBar"
    app:bb_tabXmlResource="@xml/bottombar_tabs" />
![screen shot 2017-02-22 at 12 13 53 pm](https://cloud.githubusercontent.com/assets/10890674/23198267/e7920ad8-f8f8-11e6-9494-db49bd2a2164.png)

Above the bottom bar appears a little empty space about 4dp height. The only thing helped was adding negative layout_marginTop to the bottom bar. Is this a bug? How do I fix this?

oligazar avatar Feb 22 '17 05:02 oligazar

Having exactly the same issue, using 5 tabs. Any fix for this?

Edit: Fixed this using answer found here #656. Just add app:bb_showShadow="false"

It's not very obvious since the shadow appeared on top and was white but it worked.

ruifcardoso avatar Mar 01 '17 10:03 ruifcardoso

I have also having same problem. As per my functionality I need to use drawer menu as well as bottom navigation. If I use bottom navigation with only 3 tabs than it works fine but if I extend bottom navigation with 4 or 5 tabs than it appears white space at the top of tool bar. screen2 screen1

Have you found out how to fix this?

Stayer2109 avatar Dec 30 '24 16:12 Stayer2109

I wrote in the comment above yours a fix:

Fixed this using answer found here https://github.com/roughike/BottomBar/issues/656. Just add app:bb_showShadow="false"

ruifcardoso avatar Dec 30 '24 17:12 ruifcardoso

I am facing the same problem, the white padding isn't visible in preview but its visible while running in emulator

parthmgandhi avatar Oct 21 '25 19:10 parthmgandhi