ios之UILabel创建

来源:互联网 发布:mac os x 10.11.6镜像 编辑:程序博客网 时间:2024/06/06 07:19

设置位置

UIlabel*leLabel= [[UILabelalloc]initWithFrame:CGRectMake(0,20,168,20)];

设置背景色

        leLabel.backgroundColor= [UIColorclearColor];

设置字体颜色

        leLabel.textColor= [UIColorwhiteColor];

设置文字

        leLabel.text= @"1234"
阴影颜色
        leLabel.shadowColor= [UIColorcolorWithWhite:0alpha:0.5];
阴影补偿
        
leLabel.shadowOffset= CGSizeMake(0, -1);
label字体大小
        
leLabel.font= [UIFontboldSystemFontOfSize:17];
自动适应大小
        
leLabel.adjustsFontSizeToFitWidth= YES;
        [
selfaddSubview:leLabel];
可能没有帮到你请见谅
0 0
原创粉丝点击