Bug 45908 - Grid rendering glitch
Summary: Grid rendering glitch
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
Depends on:
Reported: 2016-10-26 07:59 UTC by Philipp Sumi
Modified: 2017-03-24 21:44 UTC (History)
2 users (show)

Tags: android, grid
Is this bug a regression?: ---
Last known good build:

Screenshot of the issue (39.44 KB, image/png)
2016-10-26 07:59 UTC, Philipp Sumi
Frame containing a grid autosizes if the containing grid contains an auto-sized column. (29.95 KB, image/png)
2016-10-26 08:43 UTC, Philipp Sumi
Fixed-width columns render fine (17.23 KB, image/png)
2016-10-26 08:44 UTC, Philipp Sumi

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Philipp Sumi 2016-10-26 07:59:16 UTC
Created attachment 18224 [details]
Screenshot of the issue

I have a rather simple grid with three colums and a few rows:
        <Grid Padding="{StaticResource MediumPadding}"
              BackgroundColor="{StaticResource Primary}"

                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />

                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />


At runtime when rendering, I sometimes can observe the whole grid seems to be shifted to the left, cutting off half of the first column (which contains just an icon font icon). Navigating to the page again with the same data fixes the issue. This happens every once in a while.
Comment 1 Philipp Sumi 2016-10-26 08:41:29 UTC
Another, possibly related issue that smells buggy to me:

I have another grid, again three columns, with the following column setup:

        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />

As soon as I render a control in the third column with a rowspan of 3, not the grid, but the control that contains the grid resizes itself. This is super weird. Screenshots attached as well - I colored the background of the grid to highlight the control boundaries.

Now, if I set the third column width to a fixed value, the containing cardview renders correctly. See third screenshot.
Comment 2 Philipp Sumi 2016-10-26 08:43:13 UTC
Created attachment 18226 [details]
Frame containing a grid autosizes if the containing grid contains an auto-sized column.

As soon as I render the globe button in the auto-sized column, the grid maintains its heigth (Aqua background), but the frame that contains the grid resizes for not obvious reason, leaving the white space in the bottom.
Comment 3 Philipp Sumi 2016-10-26 08:44:16 UTC
Created attachment 18227 [details]
Fixed-width columns render fine

As soon as the third column is set to a fixed width, the frame that contains the grid maintains its proper height again.
Comment 4 Philipp Sumi 2016-10-26 18:48:22 UTC
Oh, just saw a simple repro of the first issue: This happens as soon as I click the home button and then switch back to the app. Can be reproduced on both the Android simulator (KitKat) and my Galaxy S6.
Comment 5 Jimmy [MSFT] 2017-03-24 20:00:12 UTC
Hi Philipp! Can you confirm that you are still seeing these issues with Forms or higher? If so, please attach a repro project to the report and we'll look into it. Thanks!
Comment 6 Philipp Sumi 2017-03-24 20:59:06 UTC
This went away for me when I changed the basic layout - it's possible that it was related to label alignment (there was a bug when just setting text aligment and not control alignment screwed up). It didn't reoccur anywhere anymore though (I'm on 2.3.4 pre2 now). Feel free to close :)
Comment 7 Jimmy [MSFT] 2017-03-24 21:44:54 UTC
Great! I'll go ahead and close this then. Thanks!