[Docs] Add workaround for setting a custom lineSpacing and maxNumberOfLines to ASTextNode docs#92
Merged
Merged
Conversation
maicki
force-pushed
the
MSTextNodeLineHeightDocs
branch
from
April 30, 2017 21:17
417332c to
81835ef
Compare
garrettmoon
approved these changes
May 1, 2017
| </pre> | ||
|
|
||
| <pre lang="swift" class = "swiftCode hidden"> | ||
| TODO |
Member
There was a problem hiding this comment.
Should this get to-done? Or should we just remove the swift bit for now?
| </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: |
Member
There was a problem hiding this comment.
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"
Member
|
Should we create an umbrella issue for these, reference it in the docs and close the originals? |
maicki
force-pushed
the
MSTextNodeLineHeightDocs
branch
from
May 2, 2017 22:28
81835ef to
9eea2bf
Compare
Contributor
Author
|
@garrettmoon I consolidated all issues into: #227 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are multiple reports about using
lineSpacingandmaximumNumberOfLineswithASTextNodewill result in the wrong number of lines. As this issues comes up frequently let's add something to the docs for now.Issues addressed: