0

How can I change the size of the font in a UIBarButtonItem?

John Smith
  • 12,491
  • 18
  • 65
  • 111
  • Dup of: http://stackoverflow.com/questions/2720733/how-do-you-set-the-font-size-on-a-uibarbuttonitem –  Aug 19 '10 at 04:15
  • You can find a good answer [here](http://stackoverflow.com/questions/1225457/change-the-text-of-a-uilabel-uibarbuttonitem-on-a-toolbar-programmatically) (Sorry, I'd like to comment your post instead of answer it, but I don't have enough reputation for that). – Ermiar Aug 20 '10 at 00:00

1 Answers1

4

You can easily achieve this using the following code:

barButtonName.title = @"SOME TEXT TO DISPLAY";
[barButtonName setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont boldSystemFontOfSize:15<=SIZE YOU WANT], UITextAttributeFont,nil] forState:UIControlStateNormal];
Mateus
  • 2,640
  • 5
  • 44
  • 62