Closed BrannYang closed 1 year ago
I didn't find the answer in the issue,please help me ,thank you.
After using sizetofit, the resulting rect takes up one more line than the text
xcode:14.3
example image: https://imgur.com/a/zrTcKsz
code: let down = Down(markdownString: "test content") let attributedString = try? down.toAttributedString() let label = UILabel(frame: CGRect(origin: CGPoint(x: 0, y: 100), size: CGSize(width: self.view.frame.size.width, height: 0))) label.numberOfLines = 0 label.isUserInteractionEnabled = true label.attributedText = attributedString; label.sizeToFit() label.backgroundColor = UIColor.green self.view.addSubview(label)
I solved this problem, I found that he will automatically add a newline at the end
I didn't find the answer in the issue,please help me ,thank you.
After using sizetofit, the resulting rect takes up one more line than the text
xcode:14.3
example image: https://imgur.com/a/zrTcKsz
code: let down = Down(markdownString: "test content") let attributedString = try? down.toAttributedString() let label = UILabel(frame: CGRect(origin: CGPoint(x: 0, y: 100), size: CGSize(width: self.view.frame.size.width, height: 0))) label.numberOfLines = 0 label.isUserInteractionEnabled = true label.attributedText = attributedString; label.sizeToFit() label.backgroundColor = UIColor.green self.view.addSubview(label)