dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.16k stars 1.74k forks source link

ConstraintLayout - DimensionRatio on Android Platform issue #25427

Open abelaegerter opened 4 days ago

abelaegerter commented 4 days ago

Description

Recentrly testing write custom handlers to make a new controls, an aspect ratio view to be specific. On Android the best aproach (or at least i think) is to use a ConstraintLayout and a child with the layout_constraintDimensionRatio. Everithing goes well, handlers are registred, detect diferent platforms, etc. The problem is that on Android, if the view has not a defined WidthRequest (any number > 0) the child is not rendered as espected.

https://github.com/user-attachments/assets/e1cd61e7-ec1e-4a5e-9512-c04931c6fa83

Making the same view on native platform (AndroidStudio) it looks like this Image

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/abelaegerter/HandlersTest

Version with bug

9.0.0-rc.2.24503.2

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 11 emulator, Android 12 emulator, Android 13 device

Did you find any workaround?

No response

Relevant log output

No response

dhalenggg commented 3 days ago

This issue has been verified using Visual Studio 17.12.0 Preview 3(8.0.92, & 9.0.0-rc.2.24503.2, & 9.0.0-rc.1.24453.9). Can repro this issue at Android 14 platform.

PureWeen commented 2 days ago

@abelaegerter discussions might be a better place to start with this one.

Because this is custom layouts it probably won't get prioritized to review for a bit