首页 > 移动平台 > 详细

iOS学习-UIFont

时间:2016-01-19 23:33:51      阅读:300      评论:0      收藏:0      [点我收藏+]

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.label];

    for (NSString * familyName in [UIFont familyNames]) {
        NSLog(@"familyName:%@", familyName);
        for (NSString * fontName in [UIFont fontNamesForFamilyName:familyName]) {
            NSLog(@"fonrName:%@", fontName);
        }
    }
}
 
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (UILabel *)label {
    if (!_label) {
        _label = [[UILabel alloc]initWithFrame:CGRectMake(20, 50, self.view.frame.size.width - 40, 30)];
        _label.text = @"挂蓝高手";
        _label.textAlignment = NSTextAlignmentCenter;
        
//        _label.font = [UIFont systemFontOfSize:14];  //使用系统字体14
//        _label.font = [UIFont fontWithName:@"Heiti TC" size:25];  //使用黑体25
    }
    return _label;
}

iOS学习-UIFont

原文:http://www.cnblogs.com/MrWuYindi/p/5143667.html

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