-
Notifications
You must be signed in to change notification settings - Fork 423
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
Remove VerticalStackLayout
from StateContainerController
#1262
Remove VerticalStackLayout
from StateContainerController
#1262
Conversation
src/CommunityToolkit.Maui/Layouts/StateContainer/StateContainerController.shared.cs
Outdated
Show resolved
Hide resolved
…rController.shared.cs
Sorry I'm late to question this commit, but is this the correct way to treat this problem? The What if the consumer wants the If the current behaviour was kept unless these properties were set, that should pretty much eliminate concerns over breaking changes. Wrapping the |
Description of Change
This PR removes the
VerticalStackLayout
from theStateContainer
..NET MAUI has different behavior than Xamarin.Forms for
StackLayout
. In .NET MAUI,VerticalStackLayout
expands to the size of its children. When the children require more space than is available on the screen,VerticalStackLayout
will continue to "display" the additionalView
below the visible area on the screen.The example below uses a
ScrollView
inside ofStateContainer
. WhenStateContainerController
places theScrollView
inside of aVerticalStackLayout
, it does not scroll because the size of theVerticalStackLayout
extends past the bottom of the screen.StateContainer
withVerticalStackLayout
StateContainer
withoutVerticalStackLayout
(Fixed)ScrollView
becauseVerticalStackLayout
has laid out its children past the bottom of the screen (notice how the Yellow color extends past theButton
with aBackgroundColor = Colors.Pink
)ScrollView
is properly sizedLinked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
I've also updated
StateContainerController
to useIList<IView> originalContent
instead ofList<View> originalContent
to avoid the need to castitem
when adding it to the list.