maui icon indicating copy to clipboard operation
maui copied to clipboard

AbsoluteLayout with SizeProportional not working

Open JavierFajardoSecanda opened this issue 1 year ago • 1 comments

Description

When I use the AbsoluteLayout component and define the LayoutFlags property as SizeProportional, my application crashes.

This is the error message: Message = "Layout cycle detected. Layout could not complete."

The application works if I add to the AbsoluteLayout component the property MaximumHeightRequest. But, I don't know why I have to add this property and why it's not working without this.

Steps to Reproduce

  1. Create a new MAUI project.
  2. Create one view (MainPage) and a view model (MainPageViewModel)
  3. Adding an AbsoluteLayout component to the MainPage view
  4. Launch the application and check it's not working and we can see the error with the message: "Layout cycle detected. Layout could not complete."
  5. Add the MaximumHeightRequest property to the AbsoluteLayout component (For instance: MaximumHeightRequest="1000")
  6. Launch the application again and check it's now working

Link to public reproduction project repository

https://github.com/JavierFajardoSecanda/AbsoluteLayoutMauiTest

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows

Did you find any workaround?

The application works if I add to the AbsoluteLayout component the property MaximumHeightRequest.

Relevant log output

No response

JavierFajardoSecanda avatar May 03 '24 12:05 JavierFajardoSecanda

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar May 03 '24 12:05 github-actions[bot]

Can repro this issue at Windows platform on the latest 17.10 Preview 6(8.0.20&8.0.21).

RoiChen001 avatar May 06 '24 02:05 RoiChen001

Can also confirm, that it also happens with a StackLayout at refreshing by ViewModel

I found my bug, when trying in Debug running, and the App Started on my first Desktop. Then i switch it to a bigger Screen (other Desktop). After switching i reloaded from ViewModel by OnPropertyChanged Trigger and it crashed to App.g.i.cs UnhandledException: "Layout cycle detected. Layout could not complete."

bugtesterdani avatar May 15 '24 11:05 bugtesterdani