代码改变世界

iOS - 显示钟表数字字体

2017-07-18 09:14  菜鸟Alex  阅读(2107)  评论(0编辑  收藏  举报

找了半天只需要一行代码

  • 只需要将lbl.font = [UIFont fontWithName:@"DBLCDTempBlack" size:20];的属性设置一下即可
    UILabel * lbl = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 30)];
    [self.view addSubview:lbl];
    lbl.textColor = [UIColor blackColor];
    lbl.text = @"123456";
    lbl.font = [UIFont fontWithName:@"DBLCDTempBlack" size:20];