Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Create list with limitations/constraints of LabelLayout #123

Open
plamenterziev opened this issue Apr 11, 2017 · 5 comments
Open

Create list with limitations/constraints of LabelLayout #123

plamenterziev opened this issue Apr 11, 2017 · 5 comments

Comments

@plamenterziev
Copy link

plamenterziev commented Apr 11, 2017

LabeLayout relies on boundingRect method which does not work in all cases and I think that it would be great from documentation perspective if have a list of all limitations/constraints found so far.

I've spent few hours finding out why boundingRect does not return valid size and it turned out that it does not work if the NSAttributedString has NSParagraphStyle with line break set to NSLineBreakByTruncatingTail and the number of lines is 0

So here is one issue :)

@jingwei-huang1
Copy link
Contributor

@plamenterziev Thanks for your feedbacks. For your NSAttributedString, did you make Text and pass to LabelLayout initializer or update attributed text in config?

@jingwei-huang1
Copy link
Contributor

@plamenterziev Could you please also provide the information how you set the NSAttributedString to LayoutLabel?

@plamenterziev
Copy link
Author

@jingwei-huang1 - I am creating the Text and pass to the LabelLayout initializer (have no config)

@staguer
Copy link
Contributor

staguer commented Apr 19, 2017

@plamenterziev We can definitely mention this issue in the layout's documentation comments. Do you know of a way to come up with an exhaustive list of such issues?

In the longer term, I'm considering implementing a Layout that would render text to a layer at measurement time, avoiding any boundingRect / UILabel disagreements.

@jingwei-huang1
Copy link
Contributor

@plamenterziev I tried to reproduce the same thing, but I couldn't found the issue. Could you please also provide the code how you set it up?

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

No branches or pull requests

3 participants