Skip to content

Android display-size change causes parent and drawable children mismatch in .NET MAUI #34211

@Sathish-087

Description

@Sathish-087

Description

This is minimal replication sample using a GraphicsView with a Drawable. When the Android display size (display scaling/DPI) is changed while the app is running, the parent view layout updates but the Drawable's internal width/height is differ, causing visual alignment change. The issue occurs only while the app remains running; closing the app and reopening it restores correct matching width/height for both parent and Drawable.

Steps to Reproduce

  1. Build and run the sample app on an Android device/emulator targeting API 34 or above.
  2. Open the screen by using button to the GraphicsView backed by a Drawable page.
  3. While the app is running, change Android "Display size" (Settings > Display > Display size) so system display scaling changes.
  4. Observe that parent view size/layout updates but the Drawable's reported width/height not same based on parent, causing rendering and interaction mismatches.
  5. Close the app and relaunch — widths/heights match correctly after restart.

AndroidScreenResizeDemo.zip

AndroidScreenResizeSample.zip

Link to public reproduction project repository

No response

Version with bug

10.0.0

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android API 34 and above

Did you find any workaround?

No stable workaround found. Attempts made:

  • Forcing layout re-measure / re-layout (InvalidateMeasure, Invalidate) on parent and child.
  • Forcing redraw/invalidate on the drawable/graphics surface.
  • Programmatic re-create of the view/handler.

These did not reliably fix the drawable internal bounds after display-size change.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions