计算文字的高度和宽度--以微博会话界面中用户名为例
2015-05-23 11:01
429 查看
所用方法
// NOTE: All of the following methods will default to drawing on a baseline, limiting drawing to a single line. // To correctly draw and size multi-line text, pass NSStringDrawingUsesLineFragmentOrigin in the options parameter. @interface NSString (NSExtendedStringDrawing) - (void)drawWithRect:(CGRect)rect options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context NS_AVAILABLE_IOS(7_0); - (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSStringDrawingContext *)context NS_AVAILABLE_IOS(7_0); @end
相关文章推荐
- 计算文字的高度和宽度--以微博会话界面中用户名(userName)为例
- 根据文字计算label的宽度和高度
- iOS自定义控件中动态计算文字控件的高度宽度
- 计算文字的高度和宽度
- 计算文字高度和宽度
- 【iOS 开发】Xcode6中计算文字的宽度或高度 ——伊禾媛
- swift中根据宽度计算文字高度的方法的封装
- 计算文字的宽度和高度
- iOS 动态计算文字高度和宽度
- Android 获取控件高度宽度三种方法,防止0的出现,计算空间宽度,文字宽度
- 计算文字在固定宽度下 折行显示后的高度
- js实现计算文字宽度
- IOS计算文字高度
- js 获取web界面宽度和高度的方法总结
- 自动计算文字的高度
- 根据文字计算label的高度
- iOS 计算文字内容的高度
- 计算textview 文字宽度
- Android下如何计算要显示的字符串所占的宽度和高度
- CSS------当内容超出div宽度后自动换行和限制文字不超出div宽度和高度