首页 > 其他 > 详细

UILabel属性

时间:2015-11-23 09:54:54      阅读:181      评论:0      收藏:0      [点我收藏+]

 UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(30, 30, 100, 300)];

    label.text = @"jvhhhhhhhhhhhhhhuuuuuuuuuvttttttttt";

    //设置label的边框宽度

    label.layer.borderWidth = 4;

    //圆角

    label.layer.cornerRadius = 30;

    label.layer.masksToBounds = YES;

    label.font = [UIFont systemFontOfSize:40];

    //换行,0表示无限行

    label.numberOfLines = 0;

    //label.enabled = NO;//是否激活

    label.tag = 1;

    label.textAlignment =  NSTextAlignmentLeft;

    [self.view addSubview:label];

    //改变其文本内容

    [self setLabelText];

}

-(void)setLabelText{

    UILabel *label = (UILabel *)[self.view viewWithTag:1];

    label.text = @"新文本";

}

 

UILabel属性

原文:http://www.cnblogs.com/banchuangshuying/p/4987383.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!