I am trying to customize the font on my Navigation Bar. Everything is fine except for some reason, when the title is too long for the Navigation Bar, it gives me a semicolon instead of ellipses (…)
How do I get the … to show that the title is cut off?
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, 240, 24)];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont fontWithName:@"My Font" size:20.0];
label.numberOfLines = 1;
label.lineBreakMode = NSLineBreakByTruncatingTail;
label.textAlignment = UITextAlignmentCenter;
label.textColor =[UIColor whiteColor];
label.text=@"Some Really Long Title Name That's Normally Dynamic";
self.navigationItem.titleView = label;
So I want the Navigation Bar to say “Some Really Long Titl…” However it keeps saying “Some Really Long Title ;”
Thanks!
The reason is that the ‘…’ glyph you see is that, one unicode glyph. The font you are using either defines that incorrectly, or it does not define it at all. If you have some font editing tools, you can probably fix it but I don’t know how. That character can be ‘typed’ on a Mac using option-;, probably why you see the ‘;’.