-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Set FillViewport to true to MauiHorizontalScrollView #26904
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
[Android] Set FillViewport to true to MauiHorizontalScrollView #26904
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
These changes also resolve the issue #9446. |
Thanks! |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one needs a new screenshot
LayoutInHorizontalScrollViewShouldExpand
654aa79 to
03cf6de
Compare
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tests are failing
- In general it seems like there are some Android MauiScrollView layout bugs that were fixed by this PR in NET10 #30672 if for some reason it's tricky to get this PR and tests working on net9 we can just target this to net10 for now
431b9d3 to
afc1f37
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
afc1f37 to
c87f512
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes layout issues in Android where child layouts inside horizontal ScrollViews were not expanding properly to fill the available space. The fix involves setting FillViewport = true on the MauiHorizontalScrollView to ensure proper layout behavior.
- Sets
FillViewport = trueonMauiHorizontalScrollViewinitialization - Adds UI test infrastructure to validate the layout behavior
- Includes test case demonstrating both horizontal and vertical ScrollView scenarios
Reviewed Changes
Copilot reviewed 3 out of 8 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Core/src/Platform/Android/MauiScrollView.cs | Sets FillViewport property to true when creating MauiHorizontalScrollView |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25462.cs | Adds NUnit test to verify layout expansion in horizontal ScrollView |
| src/Controls/tests/TestCases.HostApp/Issues/Issue25462.cs | Creates test page with horizontal and vertical ScrollViews to demonstrate the fix |
| Children = { | ||
| new Label | ||
| { | ||
| AutomationId="label", |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AutomationId 'label' is too generic and may not be unique across the test suite. Consider using a more specific identifier like 'Issue25462Label' or 'HorizontalScrollViewLabel' to ensure uniqueness and prevent WaitForElement failures.
Copilot uses AI. Check for mistakes.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…t#26904) * [Android] Set FillViewport to true to MauiHorizontalScrollView * Added snapshots * Update Issue25462.cs * Updated snapshots * Fixed mac snapshot
* [Android] Set FillViewport to true to MauiHorizontalScrollView * Added snapshots * Update Issue25462.cs * Updated snapshots * Fixed mac snapshot
Issues Fixed
Fixes #25462
Fixes #25655
Fixes #9446