Scrollview with ScrollView VerticalOptions="Center" not growing to fit contents on iOS #23084
Labels
area-controls-scrollview
ScrollView
platform/iOS 🍎
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
When a ScrollView has dynamic contents ( in this example, a view that is growing in size, or made visible )
it doesnt grow to fit its contents on iOS, but it does on Android
Steps to Reproduce
Create a xaml file with following contents
`
with codebehind :
`namespace mauiscrollissue;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
`
On tapping the button,
-on Android the scrollview grows until it reaches the max height, and then shows the scrolling behavior
-on iOS the scrollview doesnt grow and immediately shows scrolling behavior
Link to public reproduction project repository
https://github.com/krime81/mauiscrollissue
Version with bug
9.0.0-preview.1.9973
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
add this handler :
` Microsoft.Maui.Handlers.ScrollViewHandler.Mapper.AppendToMapping(nameof(IScrollView.ContentSize), (h, v) =>
{
var contentSize = h.VirtualView.ContentSize;
note that this might affect other instances of the scrollview in your projects
Relevant log output
No response
The text was updated successfully, but these errors were encountered: