您的位置:首页 > 产品设计 > UI/UE

UILabel属性

2015-11-23 08:46 393 查看
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 = @"新文本";

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: