我想在 UITableViewCell
的 UILable
中使用不同的字体名称。我尝试了很多例子,比如:
Cell.cellSectionLabel.text = [self.textsInTableSection objectAtIndex:0];
Cell.cellSectionImageView.image = [UIImage imageNamed:[self.imagesInTableSection objectAtIndex:0]];
Cell.cellSectionLabel.textColor = [UIColor colorWithRed:59.0f/255.0f green:56.0f/255.0f blue:62.0f/255.0f alpha:1.0f];
[Cell.cellSectionLabel setFont:[UIFont fontWithName:@"Helvetica" size:16]];
Cell.cellSectionLabel.font = [UIFont systemFontOfSize:16];
在 cellForRowAtIndexPath
中
它不起作用。字体名称实际上读取了我设备的默认字体。因为如果我在这里使用一些不同的字体名称 [Cell.cellSectionLabel setFont:[UIFont fontWithName:@"Baskerville"size:16]];
,它不会改变任何东西。它保持不变。在这种情况下如何使用不同的字体名称?
非常感谢。
最佳答案
您正在将其设置回系统字体。删除这一行:
Cell.cellSectionLabel.font = [UIFont systemFontOfSize:16];
关于ios - 如何在 UITableViewCell UILabel 中使用不同的字体名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29362484/