diff --git a/_posts/2013/2013-03-11-core-text.md b/_posts/2013/2013-03-11-core-text.md index 2abcd07..ad45eb7 100644 --- a/_posts/2013/2013-03-11-core-text.md +++ b/_posts/2013/2013-03-11-core-text.md @@ -61,7 +61,7 @@ Printing description of attributedString: [_textView insertText:attributedString]; {% endhighlight %} -![](http://ww1。sinaimg。cn/bmiddle/65cc0af7gw1e2rnc6to9cj.jpg) +![](http://ww1.sinaimg.cn/bmiddle/65cc0af7gw1e2rnc6to9cj.jpg) 还有就是NSAttributedString提供对所有属性进行遍历的方法,也提供了计算在特定size下渲染实际所占的区域(boundingRectWithSize:options:) 这些这里就不介绍了。 从上面的代码可以看出其实Mac下的富文本的渲染并不是很复杂,只要将Attributed String理解和使用好,其余的事情都交给NSTextView来做了,你完全不用考虑其底层是如何取渲染的。但是在iOS平台上就没有这么幸运了,虽然iOS从3。2开始也提供了NSAttributedString,但是并没有类似NSTextView这样的控件直接来渲染Attributed String。