question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NavigationBar not visible on TabbedPage

See original GitHub issue

Hi. I am trying to follow the docs on Multi-page applications and Navigation in order to implement the same view as the C# WPF “AppShell” template, but cannot seem to figure out a way to show the Bar with the title. I can see that in the C#/WPF template <TabBar> is used with <Tab>-components as children, while in the Fabulous version, a TabbedPage is used:

let view (model: Model) dispatch =
    View.TabbedPage(
        hasNavigationBar = true,
        shellNavBarIsVisible = true,
        shellTabBarIsVisible = true,
        title = "Page title should be here",
        children = [
            View.ContentPage(
              title = "About",
              icon = InputTypes.Image.Path("tab_about.png"),
              content = View.Label(text = "About page content"))
        ])
        .ShellTabBarIsVisible(true)
        .ShellNavBarIsVisible(true)
        .HasNavigationBar(true)
        .ToolbarItems([View.ToolbarItem(text="Some text")])

Basically, I’ve tried setting all the flags I could find to true, but nothing gets shown at the top of the page.

NOTE: Adding ToolbarItems this way works just fine when using a NavigationPage instead, but not for a TabbedPage.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TimLarivierecommented, Feb 24, 2020

I’ve figured I need to wrap the Label in View.ContentPage in order to get it work, but I am wondering whether it is possible to catch this error at compile time.

Yes, that’s something we are aware of. We started discussing it in #341.

1reaction
TimLarivierecommented, Feb 18, 2020

Alright. So TabbedPage might not be what you really want 😃 While you could make the color go all the way up, I think you would be more interested by using the Shell control, just like with the C#/XAML template.

Take a look at the Fabimals sample to see how to use Shell with Fabulous.XamarinForms. https://github.com/fsprojects/Fabulous/tree/master/Fabulous.XamarinForms/samples/Shell/Fabimals/Fabimals

(It’s a Fabulous port of the official Xaminals sample, https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/Xaminals)

Also, you can read more about Shell here: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/

Basically, Fabulous.XamarinForms covers almost all Xamarin.Forms, so if something is available in XF, chances are it’s also available in Fabulous.XamarinForms.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NavigationBar not visible on TabbedPage · Issue #670
Hi. I am trying to follow the docs on Multi-page applications and Navigation in order to implement the same view as the C#...
Read more >
Xamarin Forms Image in NavigationBar not visible
Normally , we always set the page like TabbedPage and Mater-Detail-Page as MainPage of App instead of a sub-page.
Read more >
How to get <NavigationPage.TitleView> working in ...
I have a TabbedPage with 3 tabs: <TabbedPage.Children> <views:HomePage Title="Explore" IconImageSource="ic_tab_explore.png" ...
Read more >
How to hide Navigation Bar on Xamarin Forms when using ...
Hi, I have created a Tabbed layout Xamarin project - which implements Xamarin.Forms.Shell framework for navigation.
Read more >
Xamarin Forms #33 Navigation: Tabbed Page - YouTube
... Download Visual Studio 2019 here: https://aka.ms/VisualStudio-dotnetconf19 #xamarin, #xamarinforms # tabbedpage, #CSharp.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found