首页 > 移动平台 > 详细

【代码笔记】iOS-导航条的标题(label)

时间:2017-05-23 10:01:36      阅读:292      评论:0      收藏:0      [点我收藏+]

一,效果图。

技术分享

二,代码。

技术分享
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self.view addSubview:[self getTileLabel:@"你好!"]];
    
}
//导航条的标题
-(UILabel *)getTileLabel:(NSString *)title{
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 , 200, 44)];
    titleLabel.backgroundColor = [UIColor redColor];
    titleLabel.font=[UIFont boldSystemFontOfSize:18];
    titleLabel.textColor=[UIColor greenColor];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text=title;
    return titleLabel;
}
技术分享

【代码笔记】iOS-导航条的标题(label)

原文:http://www.cnblogs.com/yang-guang-girl/p/6892510.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!