我想用来将我的应用程序UIAppearance
中所有字体的大小设置UIButtons
为 15,并将我的应用程序中所有字体的大小设置UILabels
为 10。这就是我所拥有的:
UIFont *dinMediumFont = [UIFont fontWithName:@"DINPro-Medium" size:15];
[[UILabel appearanceWhenContainedIn:[UIButton class], nil] setFont:dinMediumFont];
UIFont *dinBoldFontBig = [UIFont fontWithName:@"DINPro-Bold" size:10];
[[UILabel appearanceWhenContainedIn:nil] setFont:dinBoldFontBig];
但是,我希望按钮的字体UINavigationBars
更小,我尝试添加:
UIFont *smallerFont =[UIFont fontWithName:@"DINPro-Medium" size:15];
[[UILabel appearanceWhenContainedIn:[UIButton class], [UINavigationBar class], nil] setFont:smallerFont];
但字体保持为默认值......为什么会这样?