dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.86k stars 1.68k forks source link

[iOS] Label with specified LineHeight gets cut from top #22528

Open PavloLukianets opened 1 month ago

PavloLukianets commented 1 month ago

Description

Label with specified LineHeight gets cut from top. This works in Android!

Simulator Screenshot - iPhone 15 - 2024-05-20 at 16 25 02

Steps to Reproduce


<Grid Padding="24" 
          RowDefinitions="Auto,Auto">
        <Label BackgroundColor="Green" 
               FontSize="20"
               Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
        <Label Grid.Row="1" 
               BackgroundColor="Red" 
               LineHeight="0.8"
               FontSize="20"
               Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
    </Grid>

### Link to public reproduction project repository

_No response_

### Version with bug

8.0.21 SR4.1

### Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

### Last version that worked well

Unknown/Other

### Affected platforms

iOS, I was *not* able test on other platforms

### Affected platform versions

_No response_

### Did you find any workaround?

Setting padding from top, however we need this workaround only for strings with diactrics

### Relevant log output

_No response_
github-actions[bot] commented 1 month ago

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.

Zhanglirong-Winnie commented 1 month ago

Verified this issue with Visual Studio 17.10 Preview 7.0(8.0.408.0.21). Can repro on iOS platform. iOS: image Android: image

kubaflo commented 1 month ago

Hi, it appears to be the iOS's bug: https://github.com/facebook/react-native/issues/7687

As a workaround you can set a padding top to your label :)

        <Label BackgroundColor="Green" 
               FontSize="20"
               Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>
        <Label Grid.Row="1" 
               BackgroundColor="Red" 
               LineHeight="0.8"
               Padding="0,8,0,0"
               Text="ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ"/>