我正在尝试使用此代码将文本的字体设置为Helvetica Neue Thin

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

文本具有给定的字体,但是更改代码的大小不会影响应用程序中可见的文本。

编辑-

完整的代码块
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];

有什么原因吗?

最佳答案

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

您的字体名称不正确。

10-08 17:20