xcode 4.4.1的自定义字体不起作用。自定义DIN字体消失

时间:2012-09-19 09:06:42

标签: iphone xcode fonts uifont

我已经尝试了系统字体,它们显得很好。当我添加自定义字体时,字体根本不会出现。谁能告诉我究竟发生了什么?!它也复制在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?

1 个答案:

答案 0 :(得分:0)

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

  1. 点击 Your_Project_name-Info.plist

  2. 在关键字段中添加新对象(数组)=>在关键字段中输入应用程序提供的字体

  3. 使用字体名称

  4. 在该数组中添加对象
相关问题