question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] ScrollView nested inside StackLayout causes ScrollView to measure incorrectly

See original GitHub issue

Description

If you have the following structure

SL => ScrollView => SL => Content

The ScrollView measures out as the entire height of the content and is not scrollable on Android (haven’t tested iOS)

Steps to Reproduce

I’ve added my XAML file here

MainPage.zip

It’s basically this

    <VerticalStackLayout>

        <ScrollView Padding="{OnPlatform iOS='30,60,30,30', Default='30'}">
            <VerticalStackLayout>

                <!-- add a bunch of content here -->

            </VerticalStackLayout>
        </ScrollView>
    </VerticalStackLayout>

Expected Behavior

The content should be scrollable

Actual Behavior

The content isn’t scrollable

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hartezcommented, Aug 13, 2021

You would be correct on all of those statements.

0reactions
AmrAlSayed0commented, Nov 25, 2021

@reepmeDeveloper This happens when the contents of the ScrollView is smaller (shorter) than the space provided by the outer StackLayout. I think if you put a fixed size on the ScrollView or put some other children in the outer StackLayout that reduce the height available for the ScrollView, it will scroll.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NestedScrollView could not scroll with match_parent ...
Reason for that is that if the scrollview's child is the same size as the scrollview itself (both match_parent for height) it means...
Read more >
ScrollView not scrolling in .net MAUI
I created below code with ScrollView in .NET MAUI, when trying to scroll nothing happens. Any help would be appreciated. <ContentPage.Content> < ...
Read more >
ScrollView - .NET MAUI
In this scenario, the ScrollView causes the StackLayout to be as tall as the sum of the heights of its children. Then the...
Read more >
RecyclerView within NestedScrollView Scrolling Issue
Now what kinda problem occurred when we used nestedScrollView and put recyclerView inside nestedScrollView , it scrolls at various speeds depending on gestures....
Read more >
Common bugs in React Native ScrollView and how to fix ...
The first and most common mistake of using ScrollView is not knowing when to use it. There are two common List components in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found