美文网首页GXiOS
iOS开发--UILabel常见属性

iOS开发--UILabel常见属性

作者: Caesar_62dd | 来源:发表于2019-05-05 19:27 被阅读0次

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;
}

相关文章

网友评论

    本文标题:iOS开发--UILabel常见属性

    本文链接:https://www.haomeiwen.com/subject/bqfkoqtx.html