UITableViewCell中的字体在ios7非视网膜中呈现不佳
奇怪的行为:我有一个带有两个UILabel的自定义单元格。 当我使用表格中的单元格时,我会执行标准操作:UITableViewCell中的字体在ios7非视网膜中呈现不佳,ios,uitableview,fonts,Ios,Uitableview,Fonts,奇怪的行为:我有一个带有两个UILabel的自定义单元格。 当我使用表格中的单元格时,我会执行标准操作: -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { cell.labelVoce.text = [NSString stringWithFormat:@"%@", [[av
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.labelVoce.text = [NSString stringWithFormat:@"%@",
[[avvDB sharedDB] formatDate:[elemento objectForKey:@"start"] fromFormat:@"yyyy-MM-dd HH:mm:ss" toFormat:@"dd-MM-yyyy HH:mm"]];
cell.labelVoce.lineBreakMode = NSLineBreakByTruncatingTail;
return cell;
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.layer setRasterizationScale:[[UIScreen mainScreen] scale]];
cell.backgroundColor = [UIColor clearColor];
cell.imageView.backgroundColor = [UIColor clearColor];
}
但由于某些原因,偶数索引(2,4,6)处标签中的字体呈现得很差,如图所示。
有人知道为什么吗?在代码单元标签中有日期字符串。你能展示一下显示图中单元格的代码吗?我想问题出在我写的heightForRow方法中,它根据单元格内容改变高度。如果我放一个固定的高度,一切都很好…你为什么叫setRasterizationScale:?因为这里有人建议。。。