dewango / BottomNavigationBarXF

Bottom Navigation Bar for Xamarin Forms
MIT License
187 stars 97 forks source link

Navigation.Push BottomBar make visible on child pages #38

Open marchagele opened 7 years ago

marchagele commented 7 years ago

Is there a way to get the BottomBar visible when Navigation.push(new page()) is used? Or which is the approach to get this working?

Best regards

keytronic commented 7 years ago

@po0kie

To keep BottomBar visible you need to add NavigationPage to BottomNavigationPage's children.

public class CustomBottomNavigation : BottomBarPage
{
    public CustomBottomNavigation() 
    {
        Children.Add(new NavigationPage(new CustomPage())
        {
            Title = "Page 1",
            Icon = "ic_page1"
        });
        Children.Add(new NavigationPage(new CustomPage())
        {
            Title = "Page 2",
            Icon = "ic_page2"
        });
        Children.Add(new NavigationPage(new CustomPage())
        {
            Title = "Page 3",
            Icon = "ic_page3"
        });
    }
}

With this approach when you will use Navigation.push(new page()) on your CustomPage your bottomBar will stay visible.

sprezat commented 7 years ago

Hello this work only on Ios but not on Android platform..

keytronic commented 7 years ago

@sprezat

On my application this approach on both iOS and Android plateforms..

sprezat commented 7 years ago

Hi @JordanGout Thanks for your answer. I did exactly the same thing in my app. But with this you don't get navigation within the tabs in Android. From what I read, since the Android does not support multiple navigation stacks, that may not be possible at all.

Let me know if that's the case for you too

Thanks