Closed qaisershehzad closed 6 years ago
@qaisershehzad What is the size of your message in characters?
I tried on multiple strings of different lengths. Above screenshot String length is "1614"
Length: "348"
Length: "182"
@qaisershehzad Show me the code where you create the message, please
thanks for your quick response.
I forked and pushed code with custom font. I am changing font here https://github.com/qaisershehzad/MessageKit/blob/master/Example/Sources/SampleData.swift#L85-L86. If you uncomment line 86 and comment line 85 then it start truncating text. like below screemshot
But if you comment line 86
In my findings the height returned by https://github.com/qaisershehzad/MessageKit/blob/master/Sources/Extensions/NSAttributedString%2BExtensions.swift#L33 is incorrect for custom fonts.
Thanks for following up @qaisershehzad. I'm not sure how to handle this one because I'm relying on Foundation
to size attributed strings properly. I'm going to say it's lower priority right now considering this is regarding a custom font. If you are willing to dig deeper on this one please let us know what you find
I will investigate this a while later.
I investigated this a bit.
Actually the height returned by extension is fine for custom font as well I tried on other sample project. When we give same width it return same height in other sample project and AttributedText is also completely shown on UILabel. https://github.com/qaisershehzad/MessageKit/blob/master/Sources/Extensions/NSAttributedString%2BExtensions.swift#L33
Further I tried to disable message styling in ChatExample and a new Label is added in textMessageCell of same frame like MessageLabel here https://github.com/qaisershehzad/MessageKit/blob/master/Sources/Views/Cells/TextMessageCell.swift#L79-L103 So on this label text is fine as below screenshot.
So it seems issue is with MessageLabel configurations (text insets and framing of messageContainerView and styling).
@qaisershehzad , fixed in #645 .
General Information
iOS Version(s): 10+
Swift Version: 4
Reproducible in ChatExample? (Yes/No): yes, attached screenshot
What happened?
In Message Cell Attributed text is truncated not completely loading for long messages. Attached reference screenshot from Chat Example.
What did you expect to happen?
It should load complete message like loading for system fonts.