-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Label LineHeight not working and multiline issues #7618
Comments
repro with vs main build 32530.96.main |
Hi @EPS-Lac. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@jsuarezruiz I've tested it with the latest version. From a first, quick look, some worked, most didn't. |
Hi @EPS-Lac, you mentioned FontWeight property in your 3rd point, have you found out anything regarding when it is going to be supported if at all? |
Hey @maiia-kuzmishyna, |
Verified repro on Windows 10 with 17.6.0 Preview 6.0. Repro project.MauiApp1.zip |
I can confirm that this behavior is still present on c096b3a for Android. However, I'm not entirely sure that it's actually a bug with MAUI. To reproduce the issue, modify <Label
Text=".NET MAUI"
+ Padding="0"
+ BackgroundColor="Red"
Style="{StaticResource TitleStyle}"> You can see that there is vertical padding above and below the ".NET MAUI" text even though Changing ExplanationA MAUI label maps internally (on Android) to a Taking a look at the Android documentation for The first argument "add":
The second argument "mult":
In other words, when the text is only a single line, The other thought I had is to call Reading around, it seems like getting absolutely zero padding on a TextView in Android isn't easy. Many folks end up just using negative margin:
@jsuarezruiz We may be able to resolve this by adding some documentation for |
Hi, <Label FontSize="16"
LineHeight="18">
<Label.Text>
Some multiline
Text with
3 lines
</Label.Text>
</Label> It looks like you assumed the The documentation is unclear what the mentioned Please see #17741 for details on that. What you can do (as a poor-mans workaround) is:
|
In that specific project I solved it using other ways like margins, etc. |
Hi @EPS-Lac. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This is still an issue - the scarcely-documented behavior of The only documentation items available are
When reading these items, as a developer you will only understand that you can set it to some value and that it will change the line height of a label. However, it does not answer the question what value is needed to obtain a desired visual result (according to a design). As a result, for developers it is unclear how to consistently use this property to build apps that follow a typography design where a font size and line height are given. @jsuarezruiz Can you please reopen this issue and add it to the backlog again? Please also see #17741. |
Description
There are three issues I currently have with labels:
I've only tested on Android (SDK 26).
Steps to Reproduce
Version with bug
6.0 Release Candidate 3
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android SDK 26
Did you find any workaround?
For the multiline issue I used separate Labels for each line (for now).
Relevant log output
No response
The text was updated successfully, but these errors were encountered: