Skip to content
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

Bug with .lineSpacing attribute #371

Open
baevra opened this issue Jul 17, 2019 · 3 comments
Open

Bug with .lineSpacing attribute #371

baevra opened this issue Jul 17, 2019 · 3 comments

Comments

@baevra
Copy link

baevra commented Jul 17, 2019

.lineSpacing + .tracking or .adapt
Screen Shot 2019-07-17 at 16 53 18
.lineSpacing only
Screen Shot 2019-07-17 at 16 54 27
.lineSpacing + .tracking or .adapt
Screen Shot 2019-07-17 at 16 55 16


This bug appears only with single line strings, this is not a BonMot bug, its probably NSAttributedString bug
@ZevEisenberg Any ideas?

@ZevEisenberg
Copy link
Collaborator

@baevra would you mind posting a sample project, preferably without BonMot so that we can confirm that it’s an NSAttributedString bug? Then, I or someone else might be able to think of a workaround. But also, it will give you a good sample project to send to Apple as a bug report.

@baevra
Copy link
Author

baevra commented Jul 20, 2019

@ZevEisenberg https://github.com/baevra/NSAttributedStringBug
I found that .writeDirection + .lineSpacing also creates empty space
To fix this issue I created a wrapper (UIView) around UILabel that is calculates size in sizeThatFits and forces height to be equal to font.lineHeight if labels sizeThatFits returns height < font.lineHeight * 1.5 + .lineSpacing its weird but it works :D

@baevra
Copy link
Author

baevra commented Sep 25, 2019

In iOS 13 its works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants