计算文字的高度和宽度--以微博会话界面中用户名(userName)为例
2015-05-23 11:04
288 查看
所用方法
// 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
相关文章推荐
- 计算文字的高度和宽度--以微博会话界面中用户名为例
- swift中根据宽度计算文字高度的方法的封装
- 根据文字计算label的宽度和高度
- 计算文字高度和宽度
- 计算文字的宽度和高度
- iOS自定义控件中动态计算文字控件的高度宽度
- 计算文字的高度和宽度
- 【iOS 开发】Xcode6中计算文字的宽度或高度 ——伊禾媛
- iOS 动态计算文字高度和宽度
- Android 获取控件高度宽度三种方法,防止0的出现,计算空间宽度,文字宽度
- 计算文字在固定宽度下 折行显示后的高度
- ios 动态计算文本的高度或宽度
- 动态计算_shortLabel的文字宽度
- iOS-计算文字(字符串)高度
- iOS label根据文字多少获取宽度高度
- UILabel 文字自适应调整高度和宽度
- Android下如何计算要显示的字符串所占的宽度和高度
- UILabel的高度和宽度计算
- iOS中动态计算不同颜色、字体的文字高度
- iOS 根据文字内容动态设置宽度与高度