我在将自定义字体文件(.ttf或.otf)应用于我的表格单元字体样式时面临一个问题,它对于特殊字符(即“à”)看起来不太好,奇怪的是它确实有效与UILabel
。这是我的代码
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *cellIdentifier = @"HistoryCell";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell==nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
[cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
//cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow"]];
cell.backgroundColor=[UIColor colorWithRed:0.9647058824 green:0.9647058824 blue:0.9647058824 alpha:1];
}
UIFont* font = [UIFont fontWithName:@"EK03Serif-B01" size:18];
cell.textLabel.font=font;
NSArray *chapterName = [[fileList objectAtIndex:indexPath.row]componentsSeparatedByString:@".doc"];
cell.textLabel.text=[chapterName objectAtIndex:0];
return cell;
}