如何在iPhone上显示NSAttributedString? [英] How do I display a NSAttributedString on an iPhone?
问题描述
我相信我理解如何设置NSAttributedString值,但实际上你是如何在界面中显示它们的?
示例:UILabel,UITextView等
具体说明将不胜感激/
- 谢谢!
在iOS 6及更高版本中,您可以使用属性字符串来显示格式化的
文本视图,文本字段和一些其他控件中的文本。 AppKit
和UIKit都定义了基本属性字符串
接口的扩展,允许您在当前的
图形上下文中绘制它们的内容。
I believe I understand how to set NSAttributedString values but how on earth do you actually display them in the interface?
examples: UILabel, UITextView, etc.
Specific instructions would be greatly appreciated/
- Thanks!
In iOS 6 and later you can use attributed strings to display formatted text in text views, text fields, and some other controls. Both AppKit and UIKit also define extensions to the basic attributed string interface that allows you to draw their contents in the current graphic context.
这篇关于如何在iPhone上显示NSAttributedString?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!