pocheshire / BottomNavigationBar

Bottom Navigation Bar for Xamarin
214 stars 70 forks source link

hiding the visibility of bottom bar creates empty space #18

Open glalwani2 opened 8 years ago

glalwani2 commented 8 years ago

Hi @pocheshire ,

I am about to finish my development of app and there is one(major) problem which I am facing. The problem goes like this. In my activity I have set WindowSoftInputMode = SoftInput.AdjustPan and I am using this as my application theme

  <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
  </style>

The thing is I want to hide the bottombar when the keybaord pops -up, so for that I have added a globalListener to my rootlayout and I detect that when keyboard is up I hide thebottombar. I have attached the bottombar to the framelayout of my main.axml.Uptill now I had the above thing set but recently i had noticed that I am not able to scroll the entire view when the softkeyboard is up coz i have set adjustPan so I set it to adjustSize in my activity, Now what is happening is I am getting an empty space above my framelayout which is inside DrawerLayout, when ever I am hiding the bottomBar on keybaord pop-up. I am unable to resolve this issue can you kindly help me with that.

My main.axml looks like this

<RelativeLayout>
    <LinearLayout>
        <AppBarLayout>

              // has toolbar
              //has searchlayout
        </AppBarLayout>
        <DrawerLayout>
            <FrameLayout>
                //BottomBar attached to this framelayout
           </FrameLayout>
           <NavigationView>
             //HamburgerMenuitems
           </NavigationView>
        </DrawerLayout>
    </LinearLayout>
</RelativeLayout>

So my problem is I am not able to figure out why and from where that empty space equal to height of bottombar is coming(presumably) and how do I fix that.

Thanks again for such a great library.

SebastianBone commented 7 years ago

I have the same issue when I like to show a fragment in my activity without the bottombar. Calling "BottomBar.Hide(bool)" and the fragment UI slides down and I get an empty space on top.

Greetings Sebastian

javiholcman commented 7 years ago

Same issue Here ! Calling BottomBar.Hide(bool) set an empty space at the top, and the actionbar is broken

shrop21 commented 7 years ago

Have the same issue here. Any workarounds or fixes?

SebastianBone commented 7 years ago

Hello friends,

i found a little workaround which helps with this issue. I hope it works for you guys.

This is doing the hiding magic without the upper gap:

BottomBar.ItemContainer.Visibility = ViewStates.Gone;

and for showing:

BottomBar.ItemContainer.Visibility = ViewStates.Visible;

15mgm15 commented 6 years ago

Somehow this bug has returned from the undead.

15mgm15 commented 6 years ago

Looks like Xamarin.Forms 2.5.444934 is the one that has the issue, I rolled back to a previous version and everything is working correctly.