Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Custom Scrolling for CollectionView #13198

Closed
njsokalski opened this issue Dec 19, 2020 · 5 comments
Closed

[Enhancement] Custom Scrolling for CollectionView #13198

njsokalski opened this issue Dec 19, 2020 · 5 comments

Comments

@njsokalski
Copy link

Summary

Provide properties & methods to scroll a CollectionView to an exact position

API Changes

VerticalOffset/HorizontalOffset - The current scroll position of the CollectionView. These would be read/write so that scroll position can be set through these properties. Depending on implementation, these may be combined into a single property.
VerticalScrollGroup/HorizontalScrollGroup - Synchronizes scroll positions with other CollectionView(s)
ScrollToOffset method - This method would be used for scrolling. Parameters for different overloads may include:
OffsetX/OffsetY - The position to scroll to
OnlyIfOffscreen - Boolean specifying whether scrolling should occur if the specified offset is already visible
Animate - Boolean specifying whether scrolling should be immediate or animated
EndPositionX/EndPositionY - An enumeration value specifying whether the specified OffsetX/OffsetY should be scrolled to the Left/Center/Right/Auto. Auto would select Left or Right based on the direction the CollectionView needs to scroll to reach the desired offset.

Example Usage:

cv.VerticalOffset = 55;
cv.HorizontalOffset = 125;
cv.ScrollToOffset(offsetvaluex, offsetvaluey, false, true, PositionX.Center, PositionY.Center);
...

Intended Use Case

This would be used to remember scroll positions when reopening an app. It would also offer a way to synchronize multiple CollectionView(s). There may also be apps that wish to perform certain kinds of automated scrolling while the user performs certain actions.

@rachelkang
Copy link
Contributor

Hi, @njsokalski - thank you for submitting this proposal! We will be sure to take it into consideration.
Although I wouldn't be surprised if you're already familiar with these docs, I wanted to share our docs on CollectionView Scrolling scrolling in the meantime, for anyone reading this who may be interested

@Tommigun1980
Copy link

This is something that is absolutely needed. The fact that CollectionView can't scroll to a specific position prevents me and probably a lot of other people in converting their ListViews to CollectionViews. It is quite an oversight that developers don't have exact control over the scroll position and I'd be thrilled if this could get solved.
Thanks.

@Tommigun1980
Copy link

Pinging on this again -- any chance of adding this? I think not having proper control over the scrolling in a view that centers around scrolling is almost a bug, as it limits its use cases so much. This issue alone forces me to select a ListView over the CollectionView a lot of the times, and it is such a central concept where the lack thereof instantly makes the CollectionView at a disadvantage.

Thanks for considering.

@Keflon
Copy link

Keflon commented Aug 25, 2022

I've run into this as well - I need to synchronise the scroll-offset of multiple CollectionView instances.

This has been open for a while so may I ask, is this a difficult thing to support or is it simply low-priority from the team?

Is there a hack for this? Has anyone tried for example walking the Visual Tree and perhaps interacting somehow with whatever is found?

If I find a workaround I'll notify here.

@jfversluis
Copy link
Member

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

5 participants