//设置字体:粗体,正常的是 SystemFontOfSize
label1.font = [UIFont boldSystemFontOfSize:20];
//设置文字颜色
label1.textColor = [UIColor orangeColor];
label2.textColor = [UIColor purpleColor];
//设置文字位置
label1.textAlignment = UITextAlignmentRight;
label2.textAlignment = UITextAlignmentCenter;
//设置字体大小适应label宽度
label4.adjustsFontSizeToFitWidth = YES;
//设置label的行数
UIlabel.backgroudColor=[UIColor clearColor]; //可以去掉背景色
//设置高亮
label6.highlighted = YES;
label6.highlightedTextColor = [UIColor orangeColor];
//设置阴影
label7.shadowColor = [UIColor redColor];
label7.shadowOffset = CGSizeMake(1.0,1.0);
//设置是否能与用户进行交互
label7.userInteractionEnabled = YES;
//设置label中的文字是否可变,默认值是YES
label3.enabled = NO;
//设置文字过长时的显示格式
label3.lineBreakMode = UILineBreakModeMiddleTruncation;//截去中间
// typedef enum {
// UILineBreakModeWordWrap = 0,
// UILineBreakModeCharacterWrap,
// UILineBreakModeClip,//截去多余部分
// UILineBreakModeHeadTruncation,//截去头部
// UILineBreakModeTailTruncation,//截去尾部
// UILineBreakModeMiddleTruncation,//截去中间
// } UILineBreakMode;
//如果adjustsFontSizeToFitWidth属性设置为YES,这个属性就来控制文本基线的行为
label4.baselineAdjustment = UIBaselineAdjustmentNone;
// typedef enum {
// UIBaselineAdjustmentAlignBaselines,
// UIBaselineAdjustmentAlignCenters,
// UIBaselineAdjustmentNone,
// } UIBaselineAdjustment;