Xamarin.forms: [Bug] Shapes not loading in Xamarin ShellContent Tab once it is navigated back from other Tab

Created on 26 Aug 2020  路  4Comments  路  Source: xamarin/Xamarin.Forms

Shapes not loading in Xamarin ShellContent Tab once it is navigated back from other Tab

Steps to Reproduce

  1. Create a Sample Xamarin Shell application with 2 tabs
  2. In one of shell content Page Create an Ellipse shape
    [ />]
  3. Navigate between Pages-- Shape will not render for second time.

Expected Behavior

Shape Should render

Actual Behavior

Shape is not rendering

Basic Information

Shape is rendering Xamarin Shell only by InitializeComponent()

  • Version with issue: Xamarin Forms 4.8.0.1269
  • Last known good version:
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:

    • iOS:

    • Android:

    • UWP:

  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

Create Shape from Code Behind and insert it into layout OnAppearing()
public partial class HomePage : ContentPage
{
Int16 init = 0;
public HomePage()
{

        InitializeComponent();

        BindingContext = new Empower.ViewModel.HomePageModel();
        // var point = new Point(0,0);
        // pancakecolors.BackgroundGradientStartPoint = point;
        // pancakecolors.BackgroundGradientEndPoint = new Point(1, 1);

        init = 1;

    }

    protected override void OnAppearing()
    {
        if (init == 0)
        {

            Ellipse _elpseShape = new Ellipse();
            _elpseShape.Fill = Brush.White;
            _elpseShape.HorizontalOptions = LayoutOptions.Center;
            _elpseShape.VerticalOptions = LayoutOptions.Center;
            _elpseShape.WidthRequest = 80;
            _elpseShape.HeightRequest = 80;


            grdmyaccount.Children.RemoveAt(0);
            grdmyaccount.Children.Insert(0, _elpseShape);
        }

        init = 0;


    }


}

martin_community

shapes shell 3 in-progress bug

Most helpful comment

+1 experiencing the same issue with tabs in Shell.

All 4 comments

Attached reproduction sample
Issue11924.zip

I have the same problem with Path at even times a page with appears

var page = (page with Path);

Navigation.PushAsync(page); //it appears;
Navigation.PopAsync();
Navigation.PushAsync(page); //it does not appear
Navigation.PopAsync();
Navigation.PushAsync(page); //it appears again
and so on

+1 experiencing the same issue with tabs in Shell.

I too am hitting this same issue and am on 5.0-pre3. Only occurs following navigation, initial drawing is fine.

Was this page helpful?
0 / 5 - 0 ratings