//创建一个label
// label 的坐标和宽高
CGRect r = CGRectMake(0, 20, 200, 60); // 静态定位
UILabel *label = [[UILabel alloc]initWithFrame:r];
// label的显示文本
label.numberOfLines = 2;
label.text = @"1111111111111111111111111111111111";
// 设置阴影的颜色
label.shadowColor = [UIColor redColor];
// 设置阴影占文本的大小
label.shadowOffset = CGSizeMake(0.5, 0.5);
// 设置文本的显示颜色
label.textColor = [UIColor blackColor];
// 设置文本的对齐方式
label.textAlignment =NSTextAlignmentCenter;
// 设置文本的字体
//label.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:16];
// 输出系统所有字体
// NSArray *arr = [UIFont familyNames];
// NSLog(@"%@",arr);
UILabel的属性
最新推荐文章于 2018-07-20 10:55:25 发布