计算字符串长度
来源:互联网 发布:mt4编程手册技术大全 编辑:程序博客网 时间:2024/05/20 04:29
#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, 300, 300)]; label.backgroundColor = [UIColor yellowColor]; //设置文本 label.text = @"Hello Linux Hello Linux Hello Linux Hello Linux Hello Linux "; label.shadowColor = [UIColor redColor]; label.shadowOffset = CGSizeMake(5, -5); [self.view addSubview:label]; label.lineBreakMode = NSLineBreakByCharWrapping; label.numberOfLines = 0; CGSize textSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(300,10000) lineBreakMode:NSLineBreakByCharWrapping]; label.frame = CGRectMake(label.frame.origin.x, label.frame.origin.y, label.frame.size.width, textSize.height); label.backgroundColor = [UIColor redColor]; //字体库 NSArray *names = [UIFont familyNames]; for (NSString * name in names ) { NSLog(@"%@",name); } label.font = [UIFont fontWithName:@"Didot" size:15]; NSLog(@"%f,%f",textSize.width,textSize.height); // Do any additional setup after loading the view, typically from a nib.}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
1 0
- 计算字符串的长度
- 计算字符串长度
- java 计算字符串长度
- sql2005 计算字符串长度
- C# 计算字符串长度
- 计算字符串的长度
- 字符串长度计算
- shell 计算字符串长度
- c++ 计算字符串长度
- 计算字符串长度
- 计算字符串长度注意
- 计算字符串的长度
- ios 字符串长度计算
- 计算字符串的长度
- 字符串长度计算
- 字符串长度计算
- 计算字符串长度
- 字符串长度计算
- MVC 过滤器
- c#读取excel的xls和xlsx文件的方法
- msm8996的ION, dma-buf, iommu, dma-iommu
- Java多线程 开端
- MyEclipse使用总结——MyEclipse10安装SVN插件
- 计算字符串长度
- Swift手记 —— 关于数据结构
- Linux Socket编程(不限Linux)
- Android 之使用LocalBroadcastManager解决BroadcastReceiver安全问题
- 堆和栈的区别 (转贴)
- 蓝桥杯历年预赛习题
- 零基础学习MVC(一)
- [CSS3] Background
- ASP.NET后台弹出Confirm对话框供用户进行操作