-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Scrollviewer not scrolling #11558
Copy link
Copy link
Closed
Labels
area-controls-scrollviewScrollViewScrollViewplatform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
When changing the ContentSize of the Scrollable content in Scrollviewer after OnLoad, the Scrollview does not Scroll.
Lets say I need a scrollable ItemsControl.
I would use a ScrollViewer containing a BindableLayout.
When for what ever reason it takes longer to generate the Collection bound to the Itemssource and the generated Items are greater than the ViewPort of the ScrollView, after rendering the items, the Scrollviewer does not scroll.
Steps to Reproduce
- Just run the demo on iOS
Link to public reproduction project repository
https://github.com/Larhei/Maui-Issues/tree/main/ScrollViewer/ScrollViewer
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS all
Did you find any workaround?
Subscribing the SizeChanged of the BindableLayout and setting the MinimHeightRequest helps.
Forcing an additional Measure to get it right is not my Job.
private void HandleSizeChanged(object sender, System.EventArgs e)
{
var layout = sender as Layout;
if (layout == null)
{
return;
}
layout.MinimumHeightRequest = 0;
var size = layout.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None);
if (double.IsNaN(size.Request.Height) || double.IsInfinity(size.Request.Height))
{
return;
}
layout.MinimumHeightRequest = Math.Max(size.Request.Height, size.Minimum.Height);
}
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-scrollviewScrollViewScrollViewplatform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working