-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Label not sized correctly on Android #27614
Copy link
Copy link
Labels
area-controls-labelLabel, SpanLabel, Spanarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Milestone
Description
PR REVERTED #30023
Description
Label not sized correctly on Android. The issue can be reproduced with the simple code below:
<?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="MauiApp1.MainPage">
<ScrollView>
<VerticalStackLayout>
<Grid VerticalOptions="Start" BackgroundColor="Aquamarine">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0"
HorizontalOptions="Start"
Margin="5,5"
Text="Label and parent layout is behaving_differently_in_iOS"
BackgroundColor="Orchid"
TextColor="Black"
FontSize="20"/>
</Grid>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
We can see that the rendered Label, in case text is multi lines, is not identical on Android:

Even can get a wrong result using different HorizotalOptions values (Start, Center, End):
Steps to Reproduce
- Create a new MAUI app (targeting .NET 8 or 9) and use the XAML code above.
- Run the app on Android emulator and iOS simulator. You should see the Label is rendered differently on Android and iOS.
Link to public reproduction project repository
No response
Version with bug
9.0.30 SR3
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-labelLabel, SpanLabel, Spanarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done
