UILabel标签
2015-09-19 19:19
381 查看
创建label:
透明度:
文字及颜色:
设置文字居中中/左对齐/右对齐
设置弧度,边框,颜色::
RBG三原色:
编辑框外内容:
根据文本自适应行数:
文本阴影颜色:
阴影效果:
UILabel *label = [UILabel alloc] initWithFrame:CGRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height);
透明度:
label.alpha = 1;
文字及颜色:
label.text = @"标签内容"; label.textColor = @"字体颜色"; label.backgroundColor = [UIColor grayColor];
设置文字居中中/左对齐/右对齐
Center / Left / Right label.textAlignment = [NSTextAlignmentCenter];
设置弧度,边框,颜色::
label.layer.cornerRadius = 10; label.layer.borderColor = [UIColor grayColor].CGColor; label.layer.borderWidth = 1;
RBG三原色:
label.layer.borderColor = [UIColor colorWithRed:(CGFloat) green:(CGFloat) blue:(CGFloat) alpha:(CGFloat)];
编辑框外内容:
label .layer.masksToBounds = YES;
根据文本自适应行数:
label.numberOfLines = NSIntegerMax; //先设置行数为最大值 [label sizeToFit];
文本阴影颜色:
label.shadowColor = [UIColor grayColor];
阴影效果:
(向右偏移,向下偏移) label.shadowOffset = CGSizeMake(CGFloat width, CGFloat height);
相关文章推荐
- 表格标签table深入了解
- WEB标准网页布局中尽量不要使用的HTML标签
- web标准知识――用途相似的标签
- h1标签的使用技巧
- HTML代码中标签的全部属性 中文注释说明
- jquery 实现两Select 标签项互调示例代码
- jQuery获取标签文本内容和html内容的方法
- JavaScript获取并更改input标签name属性的方法
- css样式标签和js语法属性区别
- 关于用Jquery的height()、width()计算动态插入的IMG标签的宽高的问题
- jQuery如何获取同一个类标签的所有值(默认无法获取)
- 解决JSTL foEach标签 刷新报错的方法
- js改变embed标签src值的方法
- ThinkPHP模板判断输出Empty标签用法详解
- php实现html标签闭合检测与修复方法
- ThinkPHP模板范围判断输出In标签与Range标签用法详解
- ThinkPHP分组下自定义标签库实例
- 彻底删除thinkphp3.1案例blog标签的方法
- thinkphp特殊标签用法概述
- JavaScript中的标签语句用法分析