Shell Navigation between Multiple Fly Outs

sisaackssisaacks Member ✭✭
edited November 27 in Xamarin.iOS

I have two fly outs, each has multiple tabs.
When my app loads, it loads on the first tab of my first fly out.
If I navigate to the 2nd fly out, and then back the first fly out, and try to select any items, the app crashes with a null reference exception.
What is weird, this does not happen on Android.

In the App class I originally had
MainPage = new AppShell();

I read somewhere that this would work for ios
MainPage = new NavigationPage(new AppShell());

but this did not work either.

// First Flyout
FlyoutItem Title="Items" Style="{StaticResource BaseStyle}"
Tab Title="Tab One"
ShellContent ContentTemplate="{DataTemplate local:TabOneview}"
Tab
Tab Title="Tab Two"
ShellContent ContentTemplate="{DataTemplate local:TabTwoView}"
Tab
Tab Title="Tab Three" >
ShellContent ContentTemplate="{DataTemplate local:TabThreeView}"
Tab
FlyoutItem

// Second flyout
FlyoutItem Title="Profiles" Style="{StaticResource BaseStyle}"
Tab Title="Alpha"
ShellContent ContentTemplate="{DataTemplate local:AlphaView}"
Tab
Tab Title="Bravo"
ShellContent ContentTemplate="{DataTemplate local:BravoView}"
Tab
Tab Title="Charlie"
ShellContent ContentTemplate="{DataTemplate local:CharlieView}"
Tab
Tab Title="Atmospherics" Icon="SunDarkTheme.png"
ShellContent ContentTemplate="{DataTemplate local:AtmosphericProfileView}"
Tab
FlyoutItem

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    There's no need to wrap the shell with an extra navigation page. Shell has its own navigation.

    and try to select any items, the app crashes with a null reference exception.

    It seems you want to navigate from a list page to a detail page could you please show the code about the navigating?
    Moreover, it's difficult to reproduce your issue through the XAML code you post above. Could you please share a sample so that I can look into it to find out the root cause.

Sign In or Register to comment.