Frame offsets inner content view by 1pt #23333
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
Description
The
Frame
control implements theIBorderElement
interface and unconditionally returnsIBorderElement.BorderWidth => 1
whether the border is visible or not. The default color for the border isnull
.In Xamarin.Forms you could make a round frame by instantiation
Frame
withIsClippedToBounds = true, CornerRadius = N/2, WidthRequest = N, HeightRequest = N
(roughly) and the inner content view set to theContent
property would be clipped to a circle.In MAUI, however, the inner view is offset by the
IBorderElement.BorderWidth
during layout. If you setBackgroundColor
toColors.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:
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 fromFrame
and return 0.Relevant log output
No response
The text was updated successfully, but these errors were encountered: