`

设置UILabel的背景色为透明

 
阅读更多

下面的代码:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(412, 350, 200, 30)];
label.text = NSLocalizedString(@"bootstrap_progress_label", @"");
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];

在IOS7上显示正常,但是在IOS6上显示为一个白色的色块,看不到文字。解决办法是将此Label的背景色设置为透明,即增加下面代码:

label.backgroundColor = [UIColor clearColor];

IOS7上不需要
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics