0
votes

I'm trying to hide the bar from hamburger menu, and just preserve the icon button like Uber App.

enter image description here

I have a default master page detail structure, and i tried multiple solutions :

1 - in App.xaml

<ResourceDictionary>           
        <Style TargetType="NavigationPage">
            <Setter Property="BarBackgroundColor" Value="Transparent"/>
            <Setter Property="BarTextColor" Value="Red"/>
        </Style>              
</ResourceDictionary>

2 - A MasterDetailPageRenderer

public class CustomMasterDetailRenderer : MasterDetailPageRenderer
{
    public CustomMasterDetailRenderer(Android.Content.Context context):base(context)
    {

    }
    protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
    {
        base.OnLayout(changed, left, top, right, bottom);          
        var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
        if (toolbar != null)
        {               
            toolbar.SetBackgroundColor(Android.Graphics.Color.Argb(0, 0, 0, 0));
        }            
    }
}

Unfortunately, got this as result :

enter image description here

2
How did you hide your toolbar and only show the menu button?Aniket Sharma
That the question i asked...How do that.. read the @HeikkiDev answerBobyOneKenobi
Yes, I got it now.Aniket Sharma

2 Answers

3
votes

You can hide the navigation bar in this page with (XAML):

NavigationPage.HasNavigationBar="False"

And add your own hamburger icon with tap gesture recognizer to handle the menu visibility:

MasterDetailPage masterDetailRootPage = (MasterDetailPage)Application.Current.MainPage;
masterDetailRootPage.IsPresented = true;
0
votes

Programatically to hide and show the hamburger icon

Hide / Disable

NavigationPage.SetHasNavigationBar(this, false);

Show / Enable

NavigationPage.SetHasNavigationBar(this, true);