所以我在项目中处于领先地位,并且我们在整个项目的多个地方都遇到了这个问题。当我们以标准的典型方式显示UIAlertView时,标题不会显示在警报上,只显示描述和按钮。我们按照任何人的方式进行初始化和显示:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Are you sure?" message:@"Deleting a ..." delegate:self cancelButtonTitle:@"Delete" otherButtonTitles:@"Cancel", nil];
[alert show];
还有其他人遇到过这个问题吗?我们不是导入和依赖,它改变了任何东西,我们也没有做任何我们可以告诉的事情会导致这种情况。
编辑:这是我所看到的一个例子:
答案 0 :(得分:2)
我也遇到了同样的问题。根本原因是我使用了" UIFont + Replacement"在我的项目中。在iOS 7中,系统将使用" UIFont fontWithDescriptor:"设置系统控件中标签的字体。
我添加了一个判断来检查字体替换是否用于UIAlertView等系统控件。请检查我的代码,到目前为止效果很好:
UIFontDescriptor *replaceDescriptor = descriptor;
if (![descriptor.fontAttributes objectForKey@"NSCTFontUIUsageAttribute"]
|| ![((NSString *)[descriptor.fontAttributes objectForKey:@"NSCTFontUIUsageAttribute"])
isEqualToString:@"UICTFontUsageEmphasizeBody"])
{
NSString *replacementFontName = [replacementDictionary objectForKey:descriptor.postscriptName];
replaceDescriptor = [UIFontDescriptor fontDescriptorWithName:replacementFontName size:pointSize];
}
return [self replacement_fontWithDescriptor:replaceDescriptor size:pointSize];