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

When the Border control is in RelativeLayout, RelativeLayout is not work correctly from 8.0.60 SR6 #23934

Open
cotrasys opened this issue Jul 31, 2024 · 2 comments · May be fixed by #24841
Open
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@cotrasys
Copy link

cotrasys commented Jul 31, 2024

Description

This happening on any platform but the behaivor is different.
On iOS/Mac, it causes the border control fill the screen.
On Android/Windows the content does not appear.
Any platform works correctly at 8.0.40 SR5.

8.0.40 SR5 8.0.40 SR6
8 0 40 (iPhone SE3 iOS 17 5 1) 8 0 60 (iPhone SE3 iOS 17 5 1)
image image

Steps to Reproduce

Clone the repository, build & run. If you dont' want to clone, you can follow by below step.

  1. Create a File > New .NET MAUI App
  2. Add builder.UseMauiCompatibility() to App.xaml.cs for using RelativeLayout
  3. Rewrite MainPage.xaml like this, and remove unnecessary code from MainPage.xaml.cs
<ContentPage
...
    xmlns:cmp="clr-namespace:Microsoft.Maui.Controls.Compatibility;assembly=Microsoft.Maui.Controls">
    <cmp:RelativeLayout>
        <Image
            cmp:RelativeLayout.HeightConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                           Property=Height,
                                                                           Factor=0.8}"
            cmp:RelativeLayout.WidthConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                          Property=Width,
                                                                          Factor=1}"
            cmp:RelativeLayout.YConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                      Property=Height,
                                                                      Factor=0.2}"
            Aspect="AspectFill"
            Source="dotnet_bot.png" />
        <Border
            cmp:RelativeLayout.HeightConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                           Property=Height,
                                                                           Factor=0.2}"
            cmp:RelativeLayout.WidthConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                          Property=Width,
                                                                          Factor=0.5}"
            cmp:RelativeLayout.XConstraint="{cmp:ConstraintExpression Type=RelativeToParent,
                                                                      Property=Width,
                                                                      Factor=0}"
            BackgroundColor="Tan">
            <Label Text="DotNetBotMan" VerticalTextAlignment="Center" />
        </Border>
    </cmp:RelativeLayout>
</ContentPage>
  1. This issue does not effective whether using the Shell if not. change to MainPage = new MainPage(); on App.xaml.cs if you want.
  2. Build & Run on any platform. Confirm the difference by MauiVersion switching.

Link to public reproduction project repository

https://github.com/cotrasys/RelativeLayoutIssue

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.40 SR5

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

Use Frame control instead of Border

Relevant log output

No response

@cotrasys cotrasys added the t/bug Something isn't working label Jul 31, 2024
Copy link
Contributor

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.

@RoiChen001 RoiChen001 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 31, 2024
@RoiChen001
Copy link

I can repro this issue on the latest 17.11.0 Preview 5.0 (8.0.60), but this used to work in 8.0.40.

@RoiChen001 RoiChen001 added the i/regression This issue described a confirmed regression on a currently supported version label Jul 31, 2024
@samhouts samhouts added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jul 31, 2024
@PureWeen PureWeen added this to the .NET 8 SR9 milestone Aug 1, 2024
@PureWeen PureWeen added the p/0 Work that we can't release without label Aug 1, 2024
@PureWeen PureWeen added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Aug 27, 2024
@PureWeen PureWeen removed the p/0 Work that we can't release without label Oct 1, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR9, .NET 9 SR1 Oct 1, 2024
@PureWeen PureWeen modified the milestones: .NET 9 SR1, .NET 9 SR2 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: In Progress
5 participants