How to set initial offset for ScrollViewWithOffsetTracking
I am using ScrollViewWithOffsetTracking and want to set the initial scroll offset to a different value than 0. How can I do this?
Hi @codetiger
I haven't tried, but can you wrap it in a ScrollViewReader and use that proxy to scroll?
scroll to a particular id is possible, but I want to scroll to an offset. I am using this for a sliding ruler where user can select a floating point number
There's no built-in support for that, but I'd be happy to merge anything you come up with :)
@codetiger I have given this some thought, and think you should be able to wrap the ScrollViewWithOffsetTracking in a ScrollViewReader, and use its reader to control the position, or add a scrollPosition modifier to the content view, if you're using later iOS versions.
Since there are native ways to do this now, I will not add this to the SDK, and will thus close this issue. If you miss some feature in the SDK to be able to use it, please let me know.