UILable文本常见属性说明

1.text:设置标签显示文本。

2.attributedText:设置标签属性文本。

NSString *text = @"first";  

NSMutableAttributedString *textLabelStr = [[NSMutableAttributedString alloc] initWithString:text];  

[textLabelStr setAttributes:@{

                               NSForegroundColorAttributeName : [UIColor lightGrayColor],   

                               NSFontAttributeName : [UIFont systemFontOfSize:17]

                             } range:NSMakeRange(11, 10)];

label.attributedText = textLabelStr;

3.font:设置标签文本字体。

默认是系统自带字体,大小为17。

label.font = [UIFont systemFontOfSize:17]

label.font = [UIFont fontWithName:@"Arial" size:16];  

label.textColor = [UIColor blueColor];

4.textAlignment:设置标签文本对齐方式。

label.textAlignment = NSTextAlignmentCenter;  

5.lineBreakMode:设置标签文字过长时的显示方式,这个属性使用于label中文本的换行和截短。首先numberofLines必须设置为0,才有效果。

Ios代码  

label.lineBreakMode = NSLineBreakByCharWrapping;以字符为显示单位显示,后面部分省略不显示。  

label.lineBreakMode = NSLineBreakByClipping;剪切与文本宽度相同的内容长度,后半部分被删除。  

label.lineBreakMode = NSLineBreakByTruncatingHead;前面部分文字以……方式省略,显示尾部文字内容。  

label.lineBreakMode = NSLineBreakByTruncatingMiddle;中间的内容以……方式省略,显示头尾的文字内容。  

label.lineBreakMode = NSLineBreakByTruncatingTail;结尾部分的内容以……方式省略,显示头的文字内容。  

label.lineBreakMode = NSLineBreakByWordWrapping;以单词为显示单位显示,后面部分省略不显示。  

比如:

label.numberOfLines = 0

label.lineBreakMode = NSLineBreakByTruncatingMiddle;

实现效果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABMCAYAAADz7pA3AAAKo2lDQ1BJQ0MgUHJvZmlsZQAASImVlwdQFFkax1/35EQaGMkMOUnOIDkOWTKIyjADwxDGYWAAMSuLCq4BFRFQFFmCKLgqcQ2IKAYWwZx3kEVAWRcDoqKyDRzD7V3dXd2/6qv+1devv/f16/eq/g0A+RqTz0+FpQBI42UKQrzd6FHRMXScCEAADfDABBgzWRl81+Bgf4Bo/vp3fb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cCy2rZdOfNe6NdjetaHkoVtvmjPE4UMK1LCCw8nQgstIY0gKWWNtcMzTcQpF7TE84X6n1BGQiLF8j8LqLQ0zuAXG7zuoQ7rS82yo23eyEAeHzlhceEzGWI8N0LYau9EMaBIMHa8i3zxfliBvvvTKybZO0+QCxXtOsEXRnc/6Eq+L8DiIZzZs4avl9Nzym3hzG44mzvOg29HC1XSqIQ+9uaeS7VT9w27y7CjL2mYDj4aJNFNboKmZcB9DDIHYyIytfLeRxddlVgZSyMHfJjsgvfhKQaWGxcz4JwNStCtZZ+HEaGghxK+NdIoSQw+Lalmg9kq/Wbv16kw0FrbBTrRTUsrOyXtILHOwtiEFULTD7rPSj5gcHeYlCbkSNETkrMdZhUL36aIhkNTo5cITEjb0cKWGWG3+n6zy5WhY+uXCE/kUX8n31Hjt9VJJAVag0cWSd5fj3SVqsRBRcWrFarh+b0USuC7QFYlp5YWuC3TlslpRyesCXZGYVl7oukBXLqsVlfwfhN9ft7yHScEAAAAASUVORK5CYII=" alt="" />

6.enabled:设置文字内容是否可变。

7.adjustsFontSizeToFitWidth:文字内容自适应标签宽度。

8.adjustsLetterSpacingToFitWidth:根据字母的间隔自适应标签宽度,超出部分以……显示。

9.numberOfLines:标签最多显示行数。

10.minimumScaleFactor:设置最小字体,与minimumFontSize相同,minimumFontSize在IOS 6后不能使用。

11.highlightedTextColor:设置文本高亮显示颜色,与highlighted一起使用。

12.shadowColor:设置文本阴影颜色。

13.shadowColor:设置文本阴影与原文本的偏移量。label.shadowOffset = CGSizeMake(1.0, 5.0); 
14.userInteractionEnabled:设置标签是否忽略或移除用户交互。默认为NO。

15.preferredMaxLayoutWidth:优先选择标签布局的最大宽度。

16.baselineAdjustment:如果adjustsFontSizeToFitWidth属性设置为YES,这个属性就来控制文本基线的行为。

label4.baselineAdjustment = UIBaselineAdjustmentNone;  

UIBaselineAdjustmentAlignBaselines=0,默认,文本最上端与中线对齐。  

UIBaselineAdjustmentAlignCenters,   文本中线与label中线对齐。  

UIBaselineAdjustmentNone,  文本最低端与label中线对齐。

17. backgroundColor 背景颜色

ios代码:清空背景颜色

label1.backgroundColor = [UIColor clearColor];
上一篇:Android Toast效果设置


下一篇:Android核心分析之十九电话系统之GSMCallTacker