ScrollView Does Not Work When Inside A VerticalStackLayout #8990
Labels
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
p/1
Work that is important, and has been scheduled for release in this or an upcoming sprint
s/needs-verification
Indicates that this issue needs initial verification before further triage will happen
t/bug
Something isn't working
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version]
As an example when creating a new MAUI project the MainPage controls are inside a VerticalStackView inside a ScrollView. If you increase the VerticalStackView spacing to 200 you can see the page allows scrolling.
However if you want a control to be outside the Scroll you should add an outer VerticalStackView to hold the new control (e.g. a Label) and the ScrollView. In this case the ScrollView does not work, there is no scroll bar and the page can not be scrolled.
MainPage.xaml with scrolling.
Original Comments
Feedback Bot on 7/24/2022, 07:19 PM:
(private comment, text removed)
Original Solutions
Glenn Taylor solved on 7/25/2022, 08:24 AM, 0 votes:
After further research I now understand how this works and why this seems to be an issue.
The VerticalStackLayout doesn’t put any vertical constraints on the content (by definition), so there are no vertical constraints on the ScrollView. The ScrollView sizes itself to the content until it hits a vertical constraint; after that, it stops expanding and the content becomes scrollable. But since there’s no vertical constraint to hit, that never happens.
There are two solutions.
Once understood this is no longer an issue.
The text was updated successfully, but these errors were encountered: