ScrollView doesn't work properly on Android.
See original GitHub issueDescription
When I wrap a ScrollView around a VerticalStackLayout in Android specifically, or any other control really, if the controls exceed the viewing area, it’s not possible to scroll, and everything is simply truncated. https://i.imgur.com/fwfnTfi.png This same project works completely fine on Windows, though, and scrolling works perfectly. Here is the xaml:
<ScrollView>
<VerticalStackLayout
Spacing="16"
Padding="30,30"
VerticalOptions="Start">
<Label
x:Name="titleLabel"
FontSize="32"
FontFamily=""
FontAttributes="Bold"
Text="Loading..." />
<Label
x:Name="descriptionLabel"
FontSize="18"
FontFamily=""
FontAttributes="None"
Text="Loading..." />
<Image
x:Name="apodImage"
Margin="0, 30"
Source="loading.png"
HeightRequest="200"
Aspect="AspectFit" />
<Button
x:Name="refreshButton"
IsEnabled="False"
Text="Refresh"
Clicked="refreshButton_Clicked" />
<Button
x:Name="shareButton"
IsEnabled="False"
Text="Share"
Clicked="shareButton_Clicked" />
</VerticalStackLayout>
</ScrollView>
Thanks for your time!
(Top part of the code which keeps getting cut off):
Steps to Reproduce
- Create a new .NET MAUI project.
- In the default VerticalStackLayout, add some controls and then change their initial size at runtime.
- Run the project on Android.
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
All Android versions
Did you find any workaround?
edit see: https://github.com/dotnet/maui/issues/7590#issuecomment-1164968260
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Comments:20 (1 by maintainers)
Top Results From Across the Web
android - ScrollView not scrolling at all
Answer: the ScrollView is not working when used as the root element of an XML layout. It has to be wrapped inside a...
Read more >Scroll view not scrolling on Android
I've found why this is happening: the scroll view works when the screen config is set to "NOT SCROLLABLE". When the screen is...
Read more >Scroll View Problem. Solution of Scroll View in Android Studio ...
Android Studio Not work Offline: https://www.youtube.com/watch?v=xyyw2FxWSwE&t=7s How to Add App Update Button (Tab) on Menu User check App ...
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 >Working with the ScrollView | CodePath Android Cliffnotes
When an app has layout content that might be longer than the height of the device and that content should be vertically scrollable,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is my workaround for now. Every time I do something in my ViewModel that I know should affect the vertical height of the page, I call an Action that I assign to this method. By setting the Content property to null, and then back to it’s value as defined in XAML, it recalculates it’s size and works properly.
Yup. Exactly the same here. A really big problem actually; I don’t even know how this went unnoticed?