文本绘制附加选项NSStringDrawingOptions的解释

参考:https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSAttributedString_UIKit_Additions/index.html#//apple_ref/c/tdef/NSStringDrawingOptions

The UIKit framework adds methods to NSAttributedString to support the drawing of styled strings and to compute the size and metrics of a string prior to drawing. None of these methods affects the contents of the object itself, only how it is drawn on screen.

UIKit框架增加了方法NSAttributedString支持风格的字符串的绘制和计算之前绘制一个字符串的大小和度量.这些方法没有影响对象本身,它是仅绘制方式在屏幕上的内容。(只有他是在屏幕上如何绘制的)

By default, strings are drawn using the native coordinate system of iOS, where content is drawn down and to the right from the specified origin point. Whenever you are positioning string content, you should keep this orientation in mind and use the upper-left corner of the string’s bounding box as the origin point for drawing. 

默认情况下,字符串使用iOS本地坐标系统来绘制,其中内容被下拉并且在指定原点右边的本地坐标系开始绘制.当你定位的字符串的内容,你应该保持这个方向考虑,使用字符串的边框的左上角为原点进行绘制

You may use the methods described in this class extension from secondary threads in your app and not just from the main thread. However, if you use any of the methods that support an NSStringDrawingContextobject, you must not share contexts across threads or dispatch queues.

你可以使用这个类拓展中声明的方法,从你应用程序辅助线程而不仅仅是主线程.但是,如果你使用任何支持的NSStringDrawingContext对象的方法,你一定不能共享跨线程或调度队列上下文
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值