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.

[MAUI] First Tab ist not showing

See original GitHub issue

Platform (please complete the following information):

  • OS: Android
  • Device: [AndroidEmulator & Amazon Fire Tablet]
  • Sdk vervion: [Android SDK 29+]
  • MAUI: [6.0.552]

Describe the bug I am using DelayedViews in my TabSwitcher. When i am changing the layout from a FlexLayout to a Grid inside the DelayedView, the first tab will display nothing. When i open the next tab which is displaying the same kind of DelayedView(a new object from the same type) it gets displayed correctly. only the first Tab with its content will not be displayed. There is no exception being thrown or displayed in the logcat

To Reproduce Tabviewswitcher

`<tabs:ViewSwitcher x:Name=“Switcher” Animate=“True” SelectedIndex=“{Binding SelectedViewModelIndex, Mode=TwoWay}”>

                <tabs:DelayedView x:TypeArguments="contentViews:LobiPageView"
                                  AccentColor="White"
                                  BindingContext="{Binding Page1ViewModel}"
                                  Animate="True"
                                  UseActivityIndicator="True" />
                <tabs:DelayedView x:TypeArguments="contentViews:LobiPageView"
                                  BindingContext="{Binding Page2ViewModel}"
                                  AccentColor="{StaticResource Primary}"
                                  Animate="True"
                                  UseActivityIndicator="True" />
                <tabs:DelayedView x:TypeArguments="contentViews:LobiPageView"
                                  BindingContext="{Binding Page3ViewModel}"
                                  AccentColor="{StaticResource Primary}"
                                  Animate="True"
                                  UseActivityIndicator="True" />
                <tabs:DelayedView x:TypeArguments="contentViews:LobiPageView"
                                  BindingContext="{Binding Page4ViewModel}"
                                  AccentColor="{StaticResource Primary}"
                                  Animate="True"
                                  UseActivityIndicator="True" />
                <tabs:DelayedView x:TypeArguments="contentViews:LobiPageView"
                                  BindingContext="{Binding Page5ViewModel}"
                                  AccentColor="{StaticResource Primary}"
                                  Animate="True"
                                  UseActivityIndicator="True" />

            </tabs:ViewSwitcher>`

DelayedView ContentView `<StackLayout> <Grid BindableLayout.ItemsSource="{Binding PageItems}" >

    <Grid.RowDefinitions>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <BindableLayout.ItemTemplate>
        <DataTemplate>

… </DataTemplate> </Grid> </stackLayout>`

Screenshots (if applicable) First Page is not displayed image Scond Tab is displayed correctly with the same contentview image

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
roubachofcommented, May 6, 2023

Try increasing the delay then

0reactions
johnernest02commented, Aug 2, 2023

I solved this by adding an empty view in ViewSwitcher and an empty tab in the TabHostView. Problem now is the empty tab, even though it is hidden and has a width of 0, it still takes up space. Any ideas how to shrink the width to zero so it only fully “shows” 3 tabs?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET MAUI Shell tabs
The tab bar and tabs are visible in Shell apps by default. However, the tab bar can be hidden by setting the Shell....
Read more >
Net MAUI Tabbar not loading when navigating through ...
I have created flyout navigation and on one of the pages I have a tab bar with multiple tabs, in the first instance...
Read more >
Title view not displayed after navigating shell tabs #9269
NET MAUI shell application with a bottom tab bar, I noticed that the title view is removed after returning to first tab.
Read more >
Net Maui — Flyout Navigation, Tab ...
NET MAUI apps with tab and flyout navigation of Microsoft Learn that show how the layout is. So easy… MenuItem. The menu item...
Read more >
Create multi-page .NET MAUI apps with tab and ... - YouTube
NET MAUI shell to create multi-page applications with tabs and flyout ... NET MAUI app 38:27 - Tabs within a flyout menu 39:42...
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