Xamarin.forms: [Bug] [iOS] content page in tabbed page not showing inside shell tab

Created on 3 Jun 2019  路  17Comments  路  Source: xamarin/Xamarin.Forms

Description

Content inside tabbed page showing black/blank page when place a tabbed page inside shell tabbar or after Shell is navigate to another Tabbed page.

Steps to Reproduce

  1. Create a shell with bottom tabbar items.
  2. Place a tabbed page for one of the tab content or navigate to a tabbed page from shell.

Expected Behavior

The tabbed page's content is expected to be displayed.

Actual Behavior

The tabbed page's content display as black content.

Basic Information

  • Version with issue: 4.0.0.425677
  • Last known good version:
  • IDE: Visual Studio Community 2017 (15.9.6)
  • Platform Target Frameworks:

    • iOS: 12.2

  • Nuget Packages: Basic Nugets from a fresh project

Screenshots


Screenshots from simulator
2019-06-03_02-33-17-PM
2019-06-03_02-33-30-PM

Reproduction Link


TabbedPageBlankContent.zip

shell 5 in-progress iOS 馃崕 bug

Most helpful comment

same here. i want to create top tabbed on some page, i use tabbedpage just show black screen

All 17 comments

Hello, is there an ETA on this fix?

same here. i want to create top tabbed on some page, i use tabbedpage just show black screen

ETA? This is a significant issue don't you think?

Any position about this issue?

Any word on this?

Hello? Any word on this? I can't imagine a reason why this bug would not be worked on immediately...

@samhouts Please provide an update

This is on the backlog. I do not currently have an estimate of when we may begin working on it. Thanks for your patience!

Is there a workaround for this problem ? I could use shell Tabs, but then i loose the swipe controlling from tabbed pages, and with tab visibility disabled, there is no option to navigate through the tabs anymore.

When navigating to a tabbed page using pushasync inside the shell I get a black page like everyone else but if you use pushmodalasync it shows but obviously doesn't have a navigation bar, bit of a hack for the time being until the issue is solved.

Yes, I have problem like this. What we can I do?

I am also facing the same issue. The Pushmodal won't work for my scenario.

After digging deeper into this, I noticed this is not only a problem for iOS, but Android aswell Background was Black, but image and button showed. However, setting the BackgroundColor of the ContentPage of one of the tabbed pages makes the page visible. This this does not work for iOS.

Issue for me too. Will go back to pre Shell. The only reason I'm doing this is because there seems to be no support in Shell for deep hierarchy tabs where i can easily change the tab items based on the current page. Am i wrong here?

I would suggest that you create your own renderer and and overide the
ViewDidLayoutSubviews

The below code has fixed it. Change namespaces accordingly

`using System;
using DSRApp.iOS.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;

[assembly: ExportRenderer(typeof(TabbedPage),typeof(XTabbedRenderer))]
namespace DSRApp.iOS.Renderers
{
public class XTabbedRenderer: TabbedRenderer
{
Page Page => Element as Page;

    public XTabbedRenderer()
    {
    }

    public override void ViewDidLayoutSubviews()
    {
        base.ViewDidLayoutSubviews();
        if (Element == null)
            return;

        if (Element.Parent is BaseShellItem)
            Element.Layout(View.Bounds.ToRectangle());

        if (!Element.Bounds.IsEmpty)
        {
            View.Frame = new System.Drawing.RectangleF((float)Element.X, (float)Element.Y, (float)Element.Width, (float)Element.Height);
        }

        var frame = View.Frame;
        var tabBarFrame = TabBar.Frame;
        Page.ContainerArea = new Rectangle(0, 0, frame.Width, frame.Height - tabBarFrame.Height);


    }

}

}
`

I would suggest that you create your own renderer and and overide the
ViewDidLayoutSubviews

The below code has fixed it. Change namespaces accordingly

`using System;
using DSRApp.iOS.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;

[assembly: ExportRenderer(typeof(TabbedPage),typeof(XTabbedRenderer))]
namespace DSRApp.iOS.Renderers
{
public class XTabbedRenderer: TabbedRenderer
{
Page Page => Element as Page;

    public XTabbedRenderer()
    {
    }

    public override void ViewDidLayoutSubviews()
    {
        base.ViewDidLayoutSubviews();
        if (Element == null)
            return;

        if (Element.Parent is BaseShellItem)
            Element.Layout(View.Bounds.ToRectangle());

        if (!Element.Bounds.IsEmpty)
        {
            View.Frame = new System.Drawing.RectangleF((float)Element.X, (float)Element.Y, (float)Element.Width, (float)Element.Height);
        }

        var frame = View.Frame;
        var tabBarFrame = TabBar.Frame;
        Page.ContainerArea = new Rectangle(0, 0, frame.Width, frame.Height - tabBarFrame.Height);


    }

}

}
`

edit : There is no tab or possibility to swipe between tabs,it's like having a single Content Page

Guys, should use Shell for Production?

Was this page helpful?
0 / 5 - 0 ratings