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

ScrollView Does Not Work When Inside A VerticalStackLayout #8990

Closed
vsfeedback opened this issue Jul 25, 2022 · 1 comment
Closed

ScrollView Does Not Work When Inside A VerticalStackLayout #8990

vsfeedback opened this issue Jul 25, 2022 · 1 comment
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

Comments

@vsfeedback
Copy link

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.

            <label>



    <label>

    
        

            

            <label>

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.

  1. Set a HeightRequest for the ScrollView.
  2. Use a Grid instead of a VerticalStacklayout. Grid rows hold the child controls including the Scrollview.

Once understood this is no longer an issue.

@samhouts samhouts added t/bug Something isn't working 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 labels Jul 25, 2022
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jul 26, 2022
@jfversluis
Copy link
Member

Looking at the comment in vsfeedback, it seems this is resolved. Let us know if there is still something to do here. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

4 participants