IOS 字符串高度
2016-01-19 18:43
561 查看
测试代码
- (void)testStrFrame { NSString *ContentStr = @"ennghjkjhgfdfghjkjhgfwertyuiowertyuioertyuqwertyuiedrtyuiwertyuwertywertyyuiowertyuioertyuqwertyuiedrtyuiwertyuwertywerty"; CGSize size = [ContentStr getSizeWithFont:[UIFont systemFontOfSize:15] constrainedToSize:CGSizeMake(320, MAXFLOAT)]; UILabel *_labelTest = [[UILabel alloc]init]; _labelTest.numberOfLines = 0; _labelTest.font = [UIFont systemFontOfSize:15]; _labelTest.frame = CGRectMake(0, 64, 320,size.height); _labelTest.text = ContentStr; [self.view addSubview:_labelTest]; }
相关文章推荐
- ios SourceTree中添加git项目工程文件
- 最基础的 iOS 推送流程 —— 仅供开发时真机调试走通推送流程使用
- iOS中解析xml的常见使用
- xcode7.1不能运行ios7模拟器问题
- iOS页面通过KVO传值
- cordova ios 上下拖动黑边
- iOS 缓存,以及缓存大小,缓存清理等
- IOS应用内购买App开发完整流程
- iOS 7视图之间交互式过渡
- iOS方法类:CGAffineTransform的使用大概
- iOS 根据经纬度计算与地理北极夹角
- iOS崩溃调试
- iOS 设置视图半透明而子控件不透明
- iOS:实现图片的无限轮播(二)---之使用第三方库SDCycleScrollView
- iOS Xcode, 解决“Could not insert new outlet connection”的问题。
- iOS键盘遮挡解决方案--摘抄-
- iOS 保持程序后台运行
- IOS-学习笔记(2)
- ios开发的block反向传值
- ios开发的block反向传值