Bottom TabBar not showing: C# Markup #20304
Replies: 1 comment 1 reply
-
Hello @cbdefontenay! Looking at your code for the MainPage, it looks like it is inheriting from Would you be able to detail out what the expected behaviour is for the app and the navigation? My guess is that you want a root page that hosts a TabBar and the TabBar will display the HomePage/SecondPage/ThirdPage based on the selected TabBarItem? In that case, at least for the route definitions, you can take a look at the Chefs reference sample app that is doing this same exact thing. We have a "recipe" documented for how this was done here: https://platform.uno/docs/articles/external/uno.chefs/doc/toolkit/NavigationShell.html But for more detail: You can see that our "Main" route is at the parent-level in relation to the Home/Search/Favourites (which are the routes that each of the tab navigate to) And here is the XAML for the MainPage: https://github.com/unoplatform/uno.chefs/blob/a9ae7cf585c4ab1aa279fd9e0e8d411aacb1ff23/Chefs/Views/MainPage.xaml#L17-L65 Note the fact that the TabBar itself is wrapped in a parent Grid with Region.Attached="True" as well as a sibling Grid (https://github.com/unoplatform/uno.chefs/blob/a9ae7cf585c4ab1aa279fd9e0e8d411aacb1ff23/Chefs/Views/MainPage.xaml#L30-L34) that will be hosting the content driven by the TabBar (This is where the Home/Search/Favourites Pages will be displayed). This organization results in something like this: ![]() Where clicking on any of the TabBarItems will switch the Page that is displayed above the TabBar So along with changing your MainPage to inherit from Page, you should also be providing those two Grids in the MainPage Content along with the TabBar and reorganize the route maps to have your "Main" route be a parent of the routes driven by the TabBar. It's also possible not to define the "Home"/"Second"/etc. routes explicitly as the Navigation logic should be able to determine the correct view to show based on the Region Naming conventions |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Maybe I missed something in the documentation, but I created this tabbar:
I registered the routes like that:
My HomePage.cs + ViewModel:
I am using the C# Markup. The Bottom navbar showed up before I added the HomePage. Why did I do wrong? Somehow the docs are only showing how to create a tabbar in XAML, but there are no examples of how to add one using C# Markups.
Beta Was this translation helpful? Give feedback.
All reactions