-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MessageLabel cuts off text #1720
Comments
From your project you are trying to display this private func makeTestAttributedString() -> NSMutableAttributedString {
let attributedText = NSMutableAttributedString(
string: "Test\n\n\t•\tItems with testmultiline issueend")
attributedText.addAttribute(.font, value: UIFont.systemFont(ofSize: 15),
range: .init(location: 0, length: 6))
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = NSTextAlignment.natural
paragraphStyle.lineSpacing = 0
paragraphStyle.paragraphSpacing = 0
paragraphStyle.headIndent = 30
paragraphStyle.tailIndent = 0
paragraphStyle.firstLineHeadIndent = 0
paragraphStyle.lineBreakMode = .byWordWrapping
paragraphStyle.tabStops = [.init(textAlignment: .right,
location: 22,
options: [:]),
.init(textAlignment: .left, location: 30, options: [:])]
attributedText.addAttributes([
.font: UIFont.systemFont(ofSize: 15),
.paragraphStyle: paragraphStyle
], range: .init(location: 6, length: 3))
attributedText.addAttribute(.font,
value: UIFont.systemFont(ofSize: 15),
range: .init(location: 9, length: 33))
return attributedText
} Remove this line to make it work paragraphStyle.tabStops = [.init(textAlignment: .right,
location: 22,
options: [:]),
.init(textAlignment: .left, location: 30, options: [:])] Screenshot: |
@MuhtasimTanmoy At the first line in incoming message, there should be 你好,有什么可以为您 【效劳的?】, but last 4 words were cutted.(From debug view' text in right side we can see the evidence.) In the other hand, 3rd paragraph is also cutted. 当发送者发送带有表情符号的消息时,这些字符将被传递给接收者的设备。接收者的设备通过解译这些字符,将其转换为相应的图像或图标,从而可以呈现出表情符号。在不同的应用程序和设备上,表情符号的图像样【式可能会有所不同,但它们的含义和基本形状都是相同的。】 And I searched all issues but couldn't find answer, so I asked here. Environment What version of MessageKit are you using? |
I have similar problem, too. The text below is the original.
The last 4 letters are cut off. (ex) 너무 ! I have applied a lot of solutions I know, but they don't work. Please help me to find correct solution. Thank you in advance. Environment
|
The text below is my solution in Korean.
But I have to fix library. ※ The text below is not working..
|
First of all thank you for the great library. I found the issue when MessageLabel cuts off text.
I also prepared you test project where you can easy to reproduce it. In the example I use the same method for calculation label size that we have in MessageSizeCalculator.labelSize
I found that this issue is cased by this line
inside MessageLabel.swift file
To Reproduce
Just run test project you will see that the text is cutting off in contrast of regular UILabel
Expected behavior
Whole text should be visible
Screenshots
https://www.screencast.com/t/6ECllmkScpC
Environment
I use main branch (6.1.0)
iOS 14.7.1, iOS 15.2
xCode 13.2.1, swift 5
It's possible to reproduce this issue on simulator and real devices
15.2(any simulator),
15.2 (iPhone 11)
14.7.1 (iPhone 6s)
Yes, please use my project https://github.com/Pro2005/MessageKitIssue to understand the problem
Please help me to find correct solution because you know project better.
The text was updated successfully, but these errors were encountered: