Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Shapes not loading in Xamarin ShellContent Tab once it is navigated back from other Tab #11924

Closed
martinkabraham opened this issue Aug 26, 2020 · 4 comments · Fixed by #13284
Assignees
Labels
a/shapes a/shell 🐚 e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Milestone

Comments

@martinkabraham
Copy link

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

@martinkabraham martinkabraham added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 26, 2020
@jsuarezruiz jsuarezruiz changed the title [Bug] [Bug] Shapes not loading in Xamarin ShellContent Tab once it is navigated back from other Tab Aug 26, 2020
@jsuarezruiz jsuarezruiz added a/shapes a/shell 🐚 e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Aug 26, 2020
@jsuarezruiz jsuarezruiz self-assigned this Aug 26, 2020
@jsuarezruiz
Copy link
Contributor

Attached reproduction sample
Issue11924.zip

@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 26, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 26, 2020
@patrickhacens
Copy link

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

@luismts
Copy link

luismts commented Sep 16, 2020

+1 experiencing the same issue with tabs in Shell.

@Confusedfish
Copy link

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

@PureWeen PureWeen modified the milestones: 5.0.0, 5.0.1 Nov 2, 2020
rmarinho pushed a commit that referenced this issue Jan 15, 2021
…o renderer creation (#13284) fixes #12245 fixes #13225 fixes #12911 fixes #13096 fixes #13164 fixes #11924 fixes #11656 fixes #12844 fixes #12521 fixes #13407

* UI Test

* Render Shape if it has an initial size already set

* - fix ui tests

* Unified issues with the same fix.

Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.