-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Docs] Add workaround for setting a custom lineSpacing and maxNumberOfLines to ASTextNode docs #92
Conversation
417332c
to
81835ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maicki !
docs/_docs/text-node.md
Outdated
</pre> | ||
|
||
<pre lang="swift" class = "swiftCode hidden"> | ||
TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get to-done? Or should we just remove the swift bit for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Swift example
docs/_docs/text-node.md
Outdated
</div> | ||
</div> | ||
|
||
`ASTextNode` uses Text Kit internally to calculate the amount to shrink that results in the max number of lines. Unfortunately in certain cases this will result that the text will shrink too much and in the example above instead of 4, 3 lines of text and a weird gap at the bottom will show up. To get around this issue for now, you have to set the `truncationMode` explicitly to `NSLineBreakByTruncatingTail` on the text node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "internally to calculate the amount to shrink needed to result in the specified maximum number of lines."
Should be "Unfortunately, in certain cases this will result in the text shrinking too much in the above example; Instead of 4 lines of text, 3 lines of text and a weird gap at the bottom will show up"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Should we create an umbrella issue for these, reference it in the docs and close the originals? |
81835ef
to
9eea2bf
Compare
@garrettmoon I consolidated all issues into: #227 |
There are multiple reports about using
lineSpacing
andmaximumNumberOfLines
withASTextNode
will result in the wrong number of lines. As this issues comes up frequently let's add something to the docs for now.Issues addressed: