iOS开发--UILabel常见属性
2019-05-05 本文已影响0人
Caesar_62dd
UILabel常见属性
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *label = [[UILabel alloc]init];
label.frame = CGRectMake(0, 406, 375, 406);
label.text = @"I'm your mam!"
label.textColor = [UIColor yellowColor];
label.backgroundColor = [UIColor redColor];
label.font = [UIFont boldSystemFontOfSize:30.f];
label.font = [UIFont italicSystemFontOfSize:40.f];
label.lineBreakMode = NSLineBreakByTruncatingTail;
label.shadowColor = [UIColor purpleColor];
label.shadowOffset = CGSizeMake(3, -2) ;
label.numberOfLines = 0;
label.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:label];
}
隐藏当前页状态栏
- (void) viewDidLoad
{
[super viewDidLoad];
[self prefersStatusBarHidden];
}
- (BOOL) prefersStatusBarHidden
{
return YES;
}