键入粗体,然后将图像显示在UITextView中,然后显示在UILabel上?

问题描述 投票:0回答:1

我创建了一个UITextView,可以键入粗体并将图像插入文本当我保存到Firebase时,它另存为字符串文本,并以普通文本形式检索到标签(无粗体,无图像)

我如何保留所有文本字体并准确显示在标签中enter image description here

swift image textview label bold
1个回答
0
投票

label's attributedText设置为textView's attributedText

label.attributedText = textView.attributedText

另外,将label's numberOfLines设置为0

label.numberOfLines = 0
© www.soinside.com 2019 - 2024. All rights reserved.