maui
maui copied to clipboard
ScrollView is not scrollable inside of RefreshView
Description
Seems like VerticalStackLayout grows infinitely inside of RefreshView, therefore you cannot scroll any content inside of RefreshView.
Steps to Reproduce
- Run the page with the following content:
<RefreshView>
<ScrollView>
<VerticalStackLayout Spacing="50">
<Label Text="1" />
<Label Text="2" />
<Label Text="3" />
<Label Text="4" />
<Label Text="5" />
<Label Text="6" />
<Label Text="7" />
<Label Text="8" />
<Label Text="9" />
<Label Text="10" />
<Label Text="11" />
<Label Text="12" />
<Label Text="13" />
<Label Text="14" />
<Label Text="15" />
<Label Text="16" />
<Label Text="17" />
<Label Text="18" />
<Label Text="19" />
<Label Text="20" />
</VerticalStackLayout>
</ScrollView>
</RefreshView>
- Try to scroll down.
ER: Content is scrolled successfully,
AR: You cannot scroll down.
screen recording

Version with bug
Preview 14 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 12
Did you find any workaround?
You can wrap it in yet another ScrollView, so it would look something like that:
<ScrollView>
<RefreshView>
<ScrollView>
<VerticalStackLayout>
...
</VerticalStackLayout>
</ScrollView>
</RefreshView>
</ScrollView>
Relevant log output
No response
repro on Android 12 with vs 17.2.0 Preview 2.1. repro project: MauiApp5.zip
Possible relation with this - https://github.com/dotnet/maui/issues/3248 This bug still present in VS Preview 1.1
Still seeing this bug in the latest release. (Preview 5)
I am fighting with this problem :S, the workaround of making a wapper of the RefreshView with a ScrollView works in android but in IOS the Command does not execute....
My layout structure is:
<ScrollView>
<RefreshView Command="{Binding LoadUserInfoCommand}" IsRefreshing="{Binding IsRefreshing}">
<ScrollView>
<VerticalStackLayout>
https://user-images.githubusercontent.com/1795296/183256058-b6694642-1f7d-4139-b7d5-fdd553c94a11.mov
https://user-images.githubusercontent.com/1795296/183256076-a0dd8371-119b-4df2-8431-9bd40c10212d.mov
I am getting the same error, how can I fix it.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
This bug is marked as Windows/Android but iOS has the exact same issue. RefreshView is not usable with any content that is already scrollable.
Same issue here. RefreshView is pretty useless without this fixed.
There is ugly workaround, but at least application is functional.
<ScrollView>
<StackLayout>
<RefreshView IsRefreshing="{Binding IsBusy}" Command="{Binding RefreshCommand}" HorizontalOptions="FillAndExpand">
<ScrollView VerticalScrollBarVisibility="Never">
<!-- this is scrollable RefeshView area, pulling down from this content will initiate RefreshView -->
<StackLayout>
<Label Text="Account" FontAttributes="Bold"/>
<Picker ItemsSource="{Binding Accounts}" SelectedItem="{Binding SelectedAccount}" HorizontalOptions="Fill"/>
<!-- Separate Issue with RefreshView, need transparent BoxView, so RefreshView takes all the width of the screen, otherwise content is truncated -->
<BoxView HeightRequest="0" Color="Transparent" BackgroundColor="Transparent"/>
</StackLayout>
</ScrollView>
</RefreshView>
<!-- other controls, that will be scrolled as usual, but will not initiate RefreshView -->
</StackLayout>
</ScrollView>