UILabel

//设置文本内容
    label.text=@"<u color=blue>underlined</u> <uu color=red>text</uu>123123122222222222222222222";
    
    //设置文本行数
    label.numberOfLines=3;
    //设置文本颜色
    label.textColor=[UIColor redColor];
    
    //设置文本阴影颜色
    label.shadowColor=[UIColor greenColor];
    
    //设置阴影的位置
    label.shadowOffset=CGSizeMake(10,3);
    
    //设置文本透明度
    label.alpha=.5;
    //[label sizeToFit];
    
    //设置label 背景颜色
    label.backgroundColor=[UIColor blueColor];
     
    
    //设置 label 字体以及大小
    label.font=[UIFont fontWithName:@"Thonburi" size:20.f];
    
    //创建cklable 
    UILabel *cklable=[[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 100)] autorelease];
    cklable.text=@"现在很好";
    cklable.font=[UIFont fontWithName:@"Zapfino" size:29];
    //把cklable 添加到视图
    [self.view addSubview:cklable];

你可能感兴趣的:(UILabel)