我正在尝试将自己的HTML字符串解析为NSAttributedString,以便在UITextView中进行渲染.
因此,当字符串出现时:
<strong><em>这应该是粗体和斜体</strong></em>
<strong><em>
</strong></em>
我想在最终的NSAttributedString中应用一个独特的粗体和斜体字体,这样如果用户在编辑过程中从中删除了粗体或斜体字体,其余字体将保持不变.
这就是为什么我不想像其他SO答案所暗示的那样仅仅想要应用粗体斜体这样的单一字体样式的主要原因.
html nsattributedstring ios
html ×1
ios ×1
nsattributedstring ×1