Skip to content
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

Force PageContainer to call Layout on PageViewGroup #1231

Merged
merged 6 commits into from
Jun 10, 2021
Merged

Force PageContainer to call Layout on PageViewGroup #1231

merged 6 commits into from
Jun 10, 2021

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Jun 9, 2021

Fixes #1062

If the root page is shimmed and uses fragments to host other pages, the Layout method will never be called on a PageViewGroup that's backing the hosted page.

The old layout system relied on PlatformRenderer/Platform to force a layout that would set the width/height for the hosted page, and those values would be picked up during VisualElementTracker's OnLayout method.

Since PlatformRenderer is not in play in MauiAppCompatActivity, there's nothing to force the layout call to set those values. Normally the native layout system takes care of this for MAUI, but when the root is a shimmed legacy renderer that never happens.

This change modifies the PageContainer class to call Layout on the child control if the child control is a PageViewGroup (the backing class for MAUI pages on Android).

@PureWeen PureWeen merged commit beb7deb into main Jun 10, 2021
@PureWeen PureWeen deleted the fix-1062 branch June 10, 2021 04:39
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
@samhouts samhouts added the fixed-in-6.0.100-preview.5 Look for this fix in 6.0.100-preview.5! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-6.0.100-preview.5 Look for this fix in 6.0.100-preview.5!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Using a shimmed page as the root page fails to layout
4 participants