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

Frame offsets inner content view by 1pt #23333

Closed
filipnavara opened this issue Jun 28, 2024 · 3 comments · Fixed by #24582
Closed

Frame offsets inner content view by 1pt #23333

filipnavara opened this issue Jun 28, 2024 · 3 comments · Fixed by #24582
Labels
area-controls-frame Frame fixed-in-9.0.0-rc.2.24503.2 help wanted [up-for-grabs] Good issue for external contributors migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/iOS 🍎 t/bug Something isn't working
Milestone

Comments

@filipnavara
Copy link
Member

Description

The Frame control implements the IBorderElement interface and unconditionally returns IBorderElement.BorderWidth => 1 whether the border is visible or not. The default color for the border is null.

In Xamarin.Forms you could make a round frame by instantiation Frame with IsClippedToBounds = true, CornerRadius = N/2, WidthRequest = N, HeightRequest = N (roughly) and the inner content view set to the Content property would be clipped to a circle.

In MAUI, however, the inner view is offset by the IBorderElement.BorderWidth during layout. If you set BackgroundColor to Colors.Tan and then the background of the inner content to something else, you'll notice that the "border area" remains tan despite the frame having no border set.

Example of the visual artifact:
image

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.61 SR6.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

iOS, Android

Affected platform versions

No response

Did you find any workaround?

Yes, implement IBorderElement.BorderWidth in our control derived from Frame and return 0.

Relevant log output

No response

@filipnavara filipnavara added the t/bug Something isn't working label Jun 28, 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.

@PureWeen PureWeen added area-controls-frame Frame migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jun 28, 2024
@PureWeen PureWeen added this to the Backlog milestone Jun 28, 2024
@PureWeen PureWeen added platform/android 🤖 platform/iOS 🍎 help wanted [up-for-grabs] Good issue for external contributors labels Jun 28, 2024
@PureWeen
Copy link
Member

@filipnavara TBH this probably won't get scheduled any time soon.

We're marking Frame as obsolete in .NET9 so that's where we'll be putting most of our effort

@filipnavara
Copy link
Member Author

I filed the issue mostly to make it easy to search for a workaround, and I don’t expect it to get any prioritisation at all. Once I figured the root cause the workaround was just 8 lines of code in our project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-frame Frame fixed-in-9.0.0-rc.2.24503.2 help wanted [up-for-grabs] Good issue for external contributors migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/iOS 🍎 t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants