2

我已经尝试过使用系统字体,它们看起来很好。当我添加自定义字体时,字体根本不会出现。谁能告诉我到底发生了什么?!它也复制到了bungle资源中?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *cellIdentifier = @"MenuItemCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
    }

  cell.textLabel.text = [self.menuItems objectAtIndex:indexPath.row];
  cell.textLabel.textColor = [UIColor whiteColor];
  //[UIFont fontWithName:@"DIN-Regular.ttf" size:60];
  cell.textLabel.font = [UIFont fontWithName:@"DIN" size:10.0];

  return cell;
}

什么都没有出现……甚至没有默认系统 helvetica?

4

1 回答 1

0

您必须将其添加到 Your_Project_name-Info.plist 文件中,该文件可能位于您的支持文件夹中

  1. 点击Your_Project_name-Info.plist

  2. 在关键字段上添加新对象(数组)=> 类型应用程序提供的字体。

  3. 在该数组中添加一个具有字体名称的对象

于 2012-09-19T09:09:58.900 回答