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

[Enhancement] CollectionView item spacing #4681

Open
pauldipietro opened this Issue Dec 8, 2018 · 5 comments

Comments

@pauldipietro
Copy link
Member

pauldipietro commented Dec 8, 2018

Summary

The current CollectionView spec (#3172) lacks the ability to specify the amount of space between items inside of it. There are, of course, cases where a user might wish for specific spacing, and could be especially useful with the Grid layout type that CollectionView provides. This was briefly discussed and a simple Thickness value may suffice, although this can be adjusted as necessary.

API Changes

  • public Thickness ItemSpacing {get; set;}

Intended Use Case

Provide adequate space between items inside of a CollectionView.

@rasmuschristensen

This comment has been minimized.

Copy link

rasmuschristensen commented Dec 10, 2018

Where would the ItemSpacing be added? Currently I can not see a way of doing this?

@krdmllr

This comment has been minimized.

Copy link

krdmllr commented Jan 1, 2019

Does this also affect the edge spacing? As i describe here #3172 (comment) we need something in addition to the CollectionView margin to have the same spacing between the columns in a grid layout and the sides of the grid.

For example, having a thickness of 5 on all items would result in a spacing of 10 between the items and a spacing of 5 on the outside of the grid. In this case, something like an EdgeOffset of 5 would be required to keep the same spacing in- and outside of the grid.

@samhouts samhouts added this to the 4.0.0 milestone Jan 10, 2019

@hartez

This comment has been minimized.

Copy link
Member

hartez commented Jan 29, 2019

@pauldipietro I've added ItemSpacing to the CollectionView spec.

@hartez

This comment has been minimized.

Copy link
Member

hartez commented Jan 29, 2019

@krdmllr My first instinct is to say "yes, this will also effect edge spacing"; i.e., it would work like your example above with a Thickness of 5 -> 5 around the edges, 10 in between items. But I'll need to dig into the actual implementation on each platform to be totally sure; if we can reasonably limit this to inter-item spacing and leave the edges alone, then we might do that just so it's less mental effort for devs to figure out what effect margin/padding will have.

I suspect in either case we will need to address the issues you mentioned in your comment on #3172; I just don't know yet how we'd want to go about handling an EdgeOffset (or whatever we end up calling it).

@rmarinho

This comment has been minimized.

Copy link
Member

rmarinho commented Feb 3, 2019

So in #4996 I talked in adding also Padding so we can apply "insets" to the Viewport. Take note insets on CarouselView are also handle by the renderers so you can be able to select the 1st item if multiple items are on the screen and we need to push the 1st item to the center

@samhouts samhouts added this to Under consideration in Enhancements Feb 5, 2019

@samhouts samhouts moved this from Under consideration to Needs Specification in Enhancements Feb 6, 2019

@samhouts samhouts added this to To do in vNext (4.0.0) Mar 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.