隐藏 header 选项卡式导航页面 Xamarin/FreshMvvm

Hide header Tabbed Navigation Page Xamarin/FreshMvvm

我正在努力隐藏我的 TabbedNavigation 页面的 header。

    public class NavigationContainerNames
{
    public const string AuthenticationContainer = "AuthenticationContainer";
    public const string MainContainer = "MainContainer";
}

public partial class App : Xamarin.Forms.Application
{
    public App()
    {
        InitializeComponent();

        var maintTabNav = new FreshTabbedFONavigationContainer("Aerogrow", NavigationContainerNames.MainContainer);
        maintTabNav.FirstTabbedPage.On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

        maintTabNav.AddTab<AerogrowPageModel>("Aerogrow", "");
        maintTabNav.AddTab<ControlsPageModel>("Controls", "");
        maintTabNav.AddTab<AccountPageModel>("Account", "");

        var LoginPage = FreshPageModelResolver.ResolvePageModel<RegisterPageModel>();
        var LoginNav = new FreshNavigationContainer(LoginPage, NavigationContainerNames.AuthenticationContainer);

        if (DataHelpers.DataBaseHelpers.GetCurrentUser() != null)
            MainPage = maintTabNav;
        else
            MainPage = LoginNav;
    }

我创建了我的 FreshTabbed 导航页面并在其中添加了 children,但在每个选项卡中都有一个我无法隐藏的公共 header(写有 "Aerogrow")。

如果有人知道如何隐藏它,请 :)

注意:我试图隐藏槽 XAML 但它不起作用

NavigationPage.HasNavigationBar="false"

通过以下方式隐藏第一个标签页的导航栏:

var maintTabNav = new FreshTabbedFONavigationContainer("Aerogrow", NavigationContainerNames.MainContainer);
maintTabNav.FirstTabbedPage.On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
NavigationPage.SetHasNavigationBar(maintTabNav.FirstTabbedPage, false);

如果您不想在每个页面上都看到导航栏,请让您的页面继承自基页。然后在基页设置属性:

public class BasePage : ContentPage
{
    public BasePage()
    {
        NavigationPage.SetHasNavigationBar(this, false);
    }
}