我试图设置UILabel的字体大小。尽管文字大小似乎没有改变,但无论我放什么样的价值。这是我正在使用的代码。iOS:设置UILabel的字体大小以编程方式
[self setTitleLabel:[[UILabel alloc] initWithFrame:CGRectMake(320.0,0.0,428.0,50.0)]];
[[self contentView] addSubview:[self titleLabel]];
UIColor *titlebg = [UIColor clearColor];
[[self titleLabel] setBackgroundColor:titlebg];
[[self titleLabel] setTextColor:[UIColor blackColor]];
[[self titleLabel] setFont:[UIFont fontWithName:@"System" size:36]];
arrrg,只需几秒钟为时已晚,但这是对的。系统没有字体名... –
setFont在iOS 10.2中已弃用 – TheJeff