Question

Je voudrais utiliser la police de navigationItem.title's, parce que j'insérer un bouton dans titleView et ce bouton ont « ABC », mais « ABC » doit être spécifié une police. J'ai besoin cette police même à la police de titre navigationItem du système; Que dois-je faire?

Était-ce utile?

La solution

I believe it's the regular system font [UIFont systemFontWithSize:someSize]. You'll also need to set a small shadow on it to give it the same effect that the title bar has. If you use a UILabel I believe you can set the shadowOffset to be 0,-1 for the same effect as the title bar.

Autres conseils

By default, all font types are set to "System".

The font property for UINavigationItem.title is not able to set pragmatically. But you can create a UILabel and set custom font and add as subview.

Try this

UILabel *label=[[UILabel alloc]init];
label.frame=CGRectMake(100,10,200,24);   //You have to adjust frame here.
label.font=[UIFont fontWithName:@"Helvetica" size:14];
[self.navigationController.navigationItem addSubView:label];
[label release];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top