我正在尝试自定义导航栏上的字体。一切都很好,除了某种原因,当导航栏的标题太长时,它给了我一个分号而不是省略号(...)
如何让 ... 显示标题已被截断?
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;
所以我想让导航栏说“一些非常长的标题......”但是它一直在说“一些非常长的标题;”
谢谢!