-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 and VerticalStackLayout do not resize themselves on iOS #8820
Comments
@hartez any idea what is missing here? |
I also have this issue. My use case is I have a screen full of content with buttons at the bottom. In the middle of the screen, there is a label with Basic structure (attributes removed for brevity):
This is really frustrating because now I have to change how the information is laid out on the screen so that the users can tap the button at the bottom. I will most likely have to do a fixed height on the label/GridRow that should account for the most amount of text we should have but that leaves a ton of whitespace if there isn't any text. |
I also had this issue and I could resolve it by manually calling the layout update on the scrollview.
In the code behind I added this: Hope this works for you, too! |
Very nice solution. I had an async data loading situation, invoking the InvalidateMeasure() via an Action from my ViewModel did the trick. |
I think it works well if you bind the OnItemsChanged to the SizeChanged event of the VerticalStackLayout. |
@EPS-Lac thank you for the workaround, it works really well! However, in my solution, SizeChanged does not work, but if I use PropertyChanged instead, it does.
This gets called quite often, but still better than an unaccesible view. |
@EPS-Lac |
…ze themselves properly on iOS
Wonder if this is a duplicate of #9209 ? Another repro here: https://github.com/durandt/maui-issue2-ios-stacklayout-scroll |
A similar thing seems to occur for me in a BindableLayout. When I add items beyond the size of the screen the parent scrollview doesn't seem to expand. I was able to fix this using the above workaround. I added a few modifications. I have posted them below in case anyone is interested. in xaml:
in xaml.cs:
|
With the latest stable version (17.5) iOS now works the same as Android. |
@hartez I´m not sure the bug has gone away. |
Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you! |
@FM1973 +1!! |
Description
ScrollView and VerticalStackLayout do not resize themselves on iOS as they do on Android.
On toggling a control that is initially visible to be hidden. There is a blank space left where the control used to be.
If the control is set to be hidden initially and then toggled to be visible. The VerticalStackLayout and ScrollView do not resize to take into account the size of the now visible control.
Steps to Reproduce
Clone repo https://github.com/ammar-madni/MauiResizeIssueIOS
Run on android to see intended result.
Run on iOS to see the issue on iOS.
Version with bug
6.0.408 (current)
Last version that worked well
6.0.312
Affected platforms
iOS
Affected platform versions
iOS 15.5
Did you find any workaround?
I have added a margin to the bottom of the last element in VStack. This margin gets used up when the Hidden Control is toggled to be visible.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: