-
Notifications
You must be signed in to change notification settings - Fork 87
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
Only expand the label when the "more" bit is clicked #11
Comments
@ValCanBuild thanks for the issue! Would you mind making me a quick project that shows this off? It'll help me understand it a lot easier. |
@chansen22 The issue is that the |
👍 I get it. I think if you needed to get around this until I have some time to work up a way to handle this, you can subclass NantesLabel and override the touch handling. Although you might end up writing something similar to what I'd be writing for the feature itself. As for adding this functionality, maybe something like a new var you can set to force it to only respond to touches inside the |
Thanks, @chansen22, that's sounds exactly like what we want. I can understand it might be a bit expensive (though not too much) so you could have it as an optional setting on the label? |
@chansen22 yeah, though the only way I could think to do that was calculate the bounds within the text. I was playing around with a hack that worked out the bounds of the truncation token within the last line, which could be use for scoping the clicks. Unfortunately I wasn't able to get the bounds origin in terms of the overall label bounds, so could only get it to work by assuming the last line would always be the bottom of the label. Also, due to my inexperience with CoreText I was only able to calculate the bounds by piggybacking on the drawTruncation code (which works, but feels somewhat "icky" to store frames calculated during the draw pass) |
Hi, |
any updates here? |
Is there an update planned? |
When using the expand text feature of the label in a tableview and it's a large portion of its height, it consumes clicks.
Describe the solution you'd like
Ideally only expand the label when the "more" bit is clicked.
The text was updated successfully, but these errors were encountered: