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 = @"新文本";
}
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 = @"新文本";
}
相关文章推荐
- LeetCode "Range Sum Query 2D - Mutable"
- iOS子线程操作UI问题检查
- Array Question 1 unique string
- Android中子线程中更新UI的N中方法
- UVA 11775 Unique Story(DP)
- Cocoapods的pod install出现的某个错误 but they required a higher minimum deployment target.
- fastcgi_finish_request() 正确使用方式
- uitableview的空白处不能响应 touchesbegan 事件
- 【转载】COM 组件设计与应用(二)——GUID 和 接口
- android面试题 包括UI控件及数据存储内容
- iOS setValuesForKeysWithDictionary
- iOS:自定义模态动画 --UIPresentationController
- HDU 1297 Children’s Queue
- Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting的解决方法
- leetCode+Unique Paths II
- leetcode Implement Queue using Stacks
- scala的futue和promise
- HDU 1005 Number Sequence
- iOS中UIButton的titleEdgeInsets和imageEdgeInsets
- EqualsBuilder和HashCodeBuilder