Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Column and RowSpacing don't display in the colour of its parent #4946

Closed
JohnHDev opened this issue Feb 26, 2022 · 7 comments
Closed

Grid Column and RowSpacing don't display in the colour of its parent #4946

JohnHDev opened this issue Feb 26, 2022 · 7 comments
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/iOS 🍎 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@JohnHDev
Copy link

JohnHDev commented Feb 26, 2022

Description

In XF, we could add a Frame with a background colour lets say black, place a grid in it with a background colour of white, set a number of rows and columns, with row and column spacing values of 1. The colour of the frame would be visible in the row and column spacing, giving the grid the appearance of grid lines.

This isn't working in .NET Maui, we would have to add a LOT of box views to replicate the same behaviour.

Steps to Reproduce

Add a Frame with a background colour lets say black, place a grid in it with a background colour of white, set 5 rows and columns with grid length star, with row and column spacing values of 1. The colour of the frame should be visible in the row and column spacing, giving the grid the appearing of grid lines. This isn't working in .NET Maui.

Version with bug

Preview 13 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows

Affected platform versions

iOS 15, windows

Did you find any workaround?

Lots and lots of box views.

Relevant log output

No response

@JohnHDev JohnHDev added the t/bug Something isn't working label Feb 26, 2022
@XamlTest
Copy link
Collaborator

Thank you so much for your bug report! Unfortunately, we cannot reproduce your issue with the information above, could you provide a sample project and screenshots that we can reproduce your issue? That should greatly speed up the process, thanks!

@XamlTest XamlTest added the s/needs-repro Attach a solution or code which reproduces the issue label Feb 28, 2022
@ghost
Copy link

ghost commented Feb 28, 2022

Hi @JohnHDev. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@XamlTest XamlTest added the s/triaged Issue has been reviewed label Feb 28, 2022
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Feb 28, 2022
@YuqinSong YuqinSong added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 1, 2022
@YuqinSong
Copy link

Verified Repro with Windows. Repro project is available:
#4946.zip

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Mar 1, 2022
@hartez hartez self-assigned this Mar 9, 2022
@hartez hartez added this to the 6.0.300 milestone Mar 22, 2022
@samhouts samhouts removed the s/needs-attention Issue has more information and needs another look label Apr 21, 2022
@JohnHDev
Copy link
Author

@hartez Do you know if this will this be picked up before GA? We have a workaround but it is isn't very pretty.

@hartez
Copy link
Contributor

hartez commented Apr 28, 2022

The milestone is set for GA, so the goal right now is to address it before then.

@davidortinau davidortinau added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Apr 29, 2022
@hartez
Copy link
Contributor

hartez commented Apr 29, 2022

In XF, we could add a Frame with a background colour lets say black, place a grid in it with a background colour of white, set a number of rows and columns, with row and column spacing values of 1.

Based on your description, it sounds like you're talking about something like this:

<Frame BackgroundColor="Black">
    <Grid BackgroundColor="White" RowDefinitions="*,*" ColumnDefinitions="*,*" RowSpacing="1" ColumnSpacing="1">
        <Button BackgroundColor="Gray" Text="One" Margin="2" Grid.Row="0" Grid.Column="0"/>
        <Button BackgroundColor="Gray" Text="Two" Margin="2" Grid.Row="0" Grid.Column="1"/>
        <Button BackgroundColor="Gray" Text="Three" Margin="2" Grid.Row="1" Grid.Column="0"/>
        <Button BackgroundColor="Gray" Text="Four" Margin="2" Grid.Row="1" Grid.Column="1"/>
    </Grid>
</Frame>

The colour of the frame would be visible in the row and column spacing, giving the grid the appearance of grid lines.

This is not what happens in XF if you use that markup. This is how that renders:
Screenshot_20220429-104306

Which is what happens in MAUI.Controls as well (minus a Frame bug which offsets the Grid slightly).

Did you mean to set the Grid's BackgroundColor to Transparent? Or is there some other detail I'm misunderstanding?

@JohnHDev
Copy link
Author

@hartez Im embarrassed to say I have gotten this completely wrong, I misremembered code I wrote in XF many years ago.
This is indeed how I implemented gridlines, I should have checked my XF solution again before raising as a bug.
My apologies for wasting your time on this! Please close, and let's forget it ever happened.

'Nothing to see here, move along'

@JohnHDev JohnHDev closed this as completed May 2, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/iOS 🍎 platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants