有关 :

的问题报告:

Returns the size of the string if it were rendered with the specified constraints.
You can use this method to obtain the layout metrics you need to draw a string in your user interface. This method does not actually draw the string or alter the receiver’s text in any way.
This method computes the metrics needed to draw the specified string. This method lays out the receiver’s text and attempts to make it fit the specified size using the specified font and line break options. During layout, the method may break the text onto multiple lines to make it fit better. If the receiver’s text does not completely fit in the specified size, it lays out as much of the text as possible and truncates it (for layout purposes only) according to the specified line break mode. It then returns the size of the resulting truncated string. If the height specified in the size parameter is less than a single line of text, this method may return a height value that is bigger than the one specified.

翻译:返回字符串的大小如果呈现与指定的约束。您可以使用这个方法来获取布局指标需要画一个字符串在你的用户界面。这种方法并不实际绘制字符串或以任何方式改变接收机的文本。这种方法计算指标需要画出指定的字符串。这种方法列出了接收机的文本和试图使它符合指定使用指定字体大小和换行符选项。在布局中,方法可能打破文本到多个行,让它更好。如果接收机的文本并不完全符合指定的大小,它列出了尽可能多的文本,它截断(仅用于布局)根据指定的换行模式。然后它返回产生的截断字符串的大小。如果尺寸参数中指定的高度小于一行文本,这种方法可能返回一个值大于指定的一个高度。

posted on 2015-11-28 21:38  LiRenee  阅读(160)  评论(0编辑  收藏  举报