- boundingRectWithSize:options:attributes:context:
Calculates and returns the bounding rect for the receiver drawn using the given options and display characteristics, within the specified rectangle in the current graphics context.
Discussion
To correctly draw and size multi-line text, pass NSStringDrawingUsesLineFragmentOrigin in the options parameter.
This method returns fractional sizes (in the size component of the returned CGRect); to use a returned size to size views, you must raise its value to the nearest higher integer using the ceil function.
This method returns the actual bounds of the glyphs in the string. Some of the glyphs (spaces, for example) are allowed to overlap the layo
iOS中,根据给定的内容、字体,宽度,计算文本高度的函数,iOS7之前使用sizeWithFont,iOS7之后使用boundingRectWithSize。- boundingRectWithSize:options:attributes:context:Calculates and returns the bounding rect for the receiver drawn using