AbsoluteLayout with SizeProportional not working
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
- Create a new MAUI project.
- Create one view (MainPage) and a view model (MainPageViewModel)
- Adding an AbsoluteLayout component to the MainPage view
- 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."
- Add the MaximumHeightRequest property to the AbsoluteLayout component (For instance: MaximumHeightRequest="1000")
- 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
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:
- AbsoluteLayout has slightly different behavior in Maui (than in Forms) (#17673), similarity score: 0.77
- FlexLayout - Layout cycle detected. Layout could not complete. (#21898), similarity score: 0.76
- Android not allowing AbsoluteLayout/VerticalStackLayout Height and Width to be set properly (working on iOS/Windows) (#17883), similarity score: 0.74
Closed similar issues:
- Layout cycle crash on Windows with Button with image inside FlexLayout (#21548), similarity score: 0.74
- RelativeLayout crashes android app. (#12748), similarity score: 0.74
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Can repro this issue at Windows platform on the latest 17.10 Preview 6(8.0.20&8.0.21).
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."