Open
Description
Description
In a .NET 8 Windows environment, there is an issue where placing a BoxView inside a Border results in incorrect sizing. When BoxView and Border are placed separately, there are no significant issues. However, when a BoxView is nested within a Border, both the Border and BoxView are rendered at incorrect sizes.
This problem has not been observed in Android and iOS environments. It appears to be an issue exclusive to the Windows .NET 8 platform.
MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BorderTest.MainPage">
<ScrollView>
<VerticalStackLayout
Padding="30,0"
Spacing="25">
<Image
Source="dotnet_bot.png"
HeightRequest="185"
Aspect="AspectFit"/>
<HorizontalStackLayout Spacing="25" HorizontalOptions="Center">
<!--right size-->
<Border WidthRequest="55" HeightRequest="35" StrokeThickness="3" >
<Border.StrokeShape>
<RoundRectangle CornerRadius="6"/>
</Border.StrokeShape>
</Border>
<Label Text="+" VerticalOptions="Center" />
<BoxView WidthRequest="55" HeightRequest="35" Color="LightBlue" CornerRadius="6" BackgroundColor="Transparent"/>
<Label Text="=" VerticalOptions="Center" />
<!--wrong size-->
<Border WidthRequest="55" HeightRequest="35" StrokeThickness="3" >
<Border.StrokeShape>
<RoundRectangle CornerRadius="6"/>
</Border.StrokeShape>
<BoxView WidthRequest="55" HeightRequest="35" Color="LightBlue" CornerRadius="6" BackgroundColor="Transparent"/>
</Border>
</HorizontalStackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
MainPage.xaml.cs
namespace BorderTest
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
}
Steps to Reproduce
- Create a default MAUI project.
- Replace the MainPage.xaml and MainPage.xaml.cs with the code provided above.
- Build & Execute the project on Windows.
- Observe the sizes of the Border and BoxView.
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
Windows
Affected platform versions
windows10.0.19041.0
Did you find any workaround?
No response
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
BorderStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterIssues / PR's with Syncfusion collaborationThis issue described a possible regression on a currently supported version., verification pendingIssue has been reviewedVerified / Reproducible Issue ready for Engineering TriageSomething isn't working