简体   繁体   English

更改fontWithName中的size值没有可见效果

[英]changing the value of size in fontWithName has no visible effect

I'm trying to use this code to set my text's font to Helvetica Neue Thin 我正在尝试使用此代码将文本的字体设置为Helvetica Neue Thin

[UIFont fontWithName:@"Helvetica Neue Thin" size:14.0f];

The text has the given font but changing the size in the code has no effect on the text visible in the app. 文本具有给定的字体,但是更改代码的大小不会影响应用程序中可见的文本。

EDIT- 编辑-

Full block of code 完整的代码块

nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(190, 5, screenWidth-210, 15)];
    nameLabel.font = [UIFont fontWithName:@"Helvetica Neue Thin" size:6.0f];
    nameLabel.textColor = [UIColor grayColor];
    nameLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:nameLabel];

Any reasons? 有什么原因吗?

[UIFont fontWithName:@"HelveticaNeue-Thin" size:14.0];

您的字体名称不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM