基本上我的简单问题是以编程方式创建的 UILabel没有出现在 IOS 7 模拟器中,但它适用于 IOS 6 模拟器,我正在使用情节提要
我的代码是:
UILabel *lbl_top = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, 100, 100)];
lbl_top.text = text;
lbl_top.font = customFont;
lbl_top.numberOfLines = 1;
lbl_top.baselineAdjustment = UIBaselineAdjustmentAlignBaselines;
lbl_top.adjustsFontSizeToFitWidth = YES;
lbl_top.adjustsLetterSpacingToFitWidth = YES;
lbl_top.minimumScaleFactor = 10.0f/12.0f;
lbl_top.clipsToBounds = YES;
lbl_top.backgroundColor = [UIColor clearColor];
lbl_top.textColor = [UIColor blackColor];
lbl_top.textAlignment = NSTextAlignmentLeft;
lbl_top.hidden = FALSE;
lbl_top.alpha = 1.0;
[self.view addSubview:lbl_top];
控制台打印:
lbl_top 的打印说明:
UILabel: 0x8dae430; 帧 = (10 100; 100 100); text = '电源问题 - Power Surv...'; clipsToBounds = YES; 用户交互启用 = 否;层=CALayer:0x8db5f30
在 IOS 6 模拟器中
在 IOS 7 模拟器中