How to reduce the size of this navigation bar?

1

I am doing this application and I needed to remove the back arrow, and after doing this removal the bar continued to exist, leaving it very large and inelegant for my application ... Does anyone know tell me how to do it ? Below the image of how it is:

Here the part of the mainpage code:

[XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class MainPageRoot : MasterDetailPage
    {
        private ListView menu;
        private ObservableCollection<MasterPageItem> _menuLista;

        public MainPageRoot ()
        {
            InitializeComponent ();
            //menu = Master.navigationDrawerList;
            _menuLista = ItemService.GetMenuItens();
            navigationDrawerList.ItemsSource = _menuLista;
            Detail = new NavigationPage((Page)Activator.CreateInstance(typeof(MainPage)));
           NavigationPage.SetHasBackButton(this, false);


        }

        private void OnMenuItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var item = (MasterPageItem)e.SelectedItem;
            Type pagina = item.TargetType;

            Detail = new NavigationPage((Page)Activator.CreateInstance(pagina));
            IsPresented = false;
        }
    }
}

Here is my App.xaml.cs file:

public partial class App : Application
{
    public App ()
    {
        InitializeComponent();

        MainPage = new NavigationPage(new LoginPage());
    }

    protected override void OnStart ()
    {
        // Handle when your app starts
    }

    protected override void OnSleep ()
    {
        // Handle when your app sleeps
    }

    protected override void OnResume ()
    {
        // Handle when your app resumes
    }
}

    
asked by anonymous 08.02.2018 / 12:33

1 answer

1

Just remove the NavigationPage that is encapsulating your MasterDetailPage.

Somewhere after login you should be doing something like this:

// Dentro da página do login ou da view model de login você deve estar empilhando uma nova página na navigation do login.
this.Navigation.PushAsync(new MainPageRoot());

Change this code to something like this:

App.Current.MainPage = new MainPageRoot();

I hope it works.

    
08.02.2018 / 13:50