'Different behaviour between Android and Iphone with template flyout Xamarin.Forms app

When creating a new Xamarin.Forms App with the template "flyout" I get the expected behaviour on my Android Simulator Android Simulator but the same code when deployed on my Iphone Simulator doesn't show the tab bar and the flyout. They still are there, meaning that if I press the screen where the tabs and the flyout should be, I get the expected behavoiur, but the screen doesn't show these items Iphone Simulator. I am using Visual Studio 2019, the Android Simulator is "Pixel 2 Pie 9.0 - API 28 (Android 9.0 - API 28)" while the Iphone Simulator is "Iphone 11 iOS 15.2"



Solution 1:[1]

For iOS it is because there is no color on your Tabbar.

You can add on itemsApp->AppDelegate.cs->FinishedLaunching method:

if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
    UITabBar.Appearance.TintColor = UIColor.Blue;
    UITabBar.Appearance.BackgroundColor = UIColor.Blue;
    UINavigationBar.Appearance.BackgroundColor = UIColor.Blue;
}

The complete method for FinishedLaunching is:

 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
        global::Xamarin.Forms.Forms.Init();
        LoadApplication(new App());

        if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
        {
            UITabBar.Appearance.TintColor = UIColor.Blue;
            UITabBar.Appearance.BackgroundColor = UIColor.Blue;
            UINavigationBar.Appearance.BackgroundColor = UIColor.Blue;
        }

        return base.FinishedLaunching(app, options);
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1