You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
On UWP, when setting GridItemsLayout.HorizontalItemSpacing or GridItemsLayout.VerticalItemSpacing, spacing is applied not only between elements in the grid but also around the edges of the grid.
The result is that not only does the 5pt of spacing get applied between items, but it also gets applied around the edges of the CollectionView. This makes it so that the CollectionView appears offset from the search bar that's above it:
###Workaround
In my case, this spacing is undesired, but it's kind of annoying to get rid of :) One approach is to apply a negative margin to the entire CollectionView, but this means that the negative margin also affects CollectionView.EmptyView, CollectionView.Header, and CollectionView.Footer, so then we have to add margin to those elements to compensate:
If backwards compatibility isn't an issue, then my suggestion for fixing this would be to have GridItemsLayout.HorizontalItemSpacing/GridItemsLayout.VerticalItemSpacing only apply spacing between elements in the grid and not apply spacing around the edges of the grid. Then, introduce a a Margin attribute for GridItemsLayout that takes care of applying margin around the edges of the grid.
Okay, good to know, thanks. I was seeing this on UWP, so maybe it's specific to that platform. Let me update the bug's description :)
Eli-Black-Work
changed the title
[Bug] GridItemsLayout HorizontalItemSpacing shouldn't add spacing to edges
[Bug] [UWP] GridItemsLayout.HorizontalItemSpacing adds spacing to edges
Mar 9, 2020
Description
On UWP, when setting
GridItemsLayout.HorizontalItemSpacing
orGridItemsLayout.VerticalItemSpacing
, spacing is applied not only between elements in the grid but also around the edges of the grid.Steps to Reproduce
Given this XAML:
The result is that not only does the 5pt of spacing get applied between items, but it also gets applied around the edges of the CollectionView. This makes it so that the CollectionView appears offset from the search bar that's above it:
###Workaround
In my case, this spacing is undesired, but it's kind of annoying to get rid of :) One approach is to apply a negative margin to the entire
CollectionView
, but this means that the negative margin also affectsCollectionView.EmptyView
,CollectionView.Header
, andCollectionView.Footer
, so then we have to add margin to those elements to compensate:Basic Information
The text was updated successfully, but these errors were encountered: