Reputation: 707
So I am neck deep in a project, and we kept running into this problem in multiple places throughout it. When we display a UIAlertView the standard, typical way, the title doesn't display on the alert, only the description and buttons. We do the initialization and display as anyone would:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Are you sure?" message:@"Deleting a ..." delegate:self cancelButtonTitle:@"Delete" otherButtonTitles:@"Cancel", nil];
[alert show];
Has anyone else ever run into this problem? We aren't importing and dependency that changes anything with that, nor are we doing anything that we can tell would cause this.
Edit: Here's an example of what I'm seeing:
Upvotes: 0
Views: 765
Reputation: 36
I also met the same problem. The root cause is that I used "UIFont+Replacement" in my project. In iOS 7, system will use "UIFont fontWithDescriptor:" to setup font for labels in system controls.
I added a judgment to check whether the font replacement is used for system controls like UIAlertView. Please check my code, so far it works well:
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];
Upvotes: 2