How to paste rich text into a UITextView?

后端 未结 1 2001
-上瘾入骨i
-上瘾入骨i 2020-12-18 12:58

My app allows users to format text in a UITextView by clicking some formatting buttons that apply attributes to the attributedText property of the text view. I want to allow

相关标签:
1条回答
  • 2020-12-18 13:27

    Duncan asked above, "Are you sure you have the uitextview set to handle rich text." I wasn't aware of a setting for that, but I checked the UITextView class reference again and found the allowsEditingTextAttributes property. I hadn't used that before because I was providing my own formatting buttons and didn't need to enable the system Bold/Italic/Underline options. But when I set that property to YES for my UITextView, then it started accepting formatted text automatically. Whew!

    0 讨论(0)
提交回复
热议问题