Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Has anybody else hit a problem with BackgroundColor on StackLayout on WinPhone when using Spacing?

JohnHardmanJohnHardman GBUniversity admin

I am hitting a strange problem on WinPhone, where the BackgroundColor of a StackLayout is being ignored when the number of entries in the StackLayout goes over a certain number (when my app hits 57 children of the StackLayout, but remembering that some of those children have children of their own). The StackLayout is created as follows (I have hard-coded the color and spacing to assist in debugging. On iOS this works fine, but on WinPhone the moment the number of entries hits that threshold, the BackgroundColor on WinPhone switches to Black (presumably Color.Default?).

Has anybody else encountered this?

                menuStackLayout = new StackLayout
                    BackgroundColor = Color.Maroon,
                    ClassId = "MyApp_ClassId_StackLayout",
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    IsEnabled = true,
                    IsVisible = true,
                    Orientation = StackOrientation.Vertical,
                    Padding = 0,
                    Spacing = 50,
                    StyleId = kmr.StyleId,
                    VerticalOptions = LayoutOptions.FillAndExpand


John H.


  • JohandePunderJohandePunder NLBeta, University

    We have the same problem. Did you find a solution for this?


  • JohnHardmanJohnHardman GBUniversity admin

    @JohandePunder - I did raise a bug for this at . However, it's way down my priority list so I haven't created a sample project to reproduce it yet, so the Xamarin team aren't actioning it yet. If you have a sample that reproduces this could you attach it to that bug and change the status on the bug back to NEW please.

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @JohnHardman - just fyi that only Xamarin or the original bug reporter can change the status of a bug, which is really annoying because it means you have to file a new bug if the original reporter is no longer around.

  • JohnHardmanJohnHardman GBUniversity admin

    @AdamP - Thanks for that. Didn't realise that.

    @JohandePunder - If you can add any info you have to the bug, I'll change the status afterwards. Just tag me here so that I remember to do it :-)

Sign In or Register to comment.