Skip to content

Instantly share code, notes, and snippets.

@Nub
Created October 10, 2011 15:43
Show Gist options
  • Select an option

  • Save Nub/1275649 to your computer and use it in GitHub Desktop.

Select an option

Save Nub/1275649 to your computer and use it in GitHub Desktop.
/* Custom Navigation Bar Title/Label */
float width = self.navigationController.navigationBar.bounds.size.width;
float height = self.navigationController.navigationBar.bounds.size.height;
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, height)];
titleLabel.textColor = UIColorFromRGB(0x79644f);
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont boldSystemFontOfSize:20.0f];
titleLabel.textAlignment = UITextAlignmentCenter;
self.navigationItem.titleView = titleLabel;
titleLabel.text = NSLocalizedString(@"Steve Jobs Tribute", @"Steve Jobs Tribute");
/* Create new Tribute Button */
UIBarButtonItem *focusTest = [[UIBarButtonItem alloc] initWithTitle:@"Add Tribute" style:UIBarButtonItemStylePlain target:self action:@selector(addTribute:)];
self.navigationItem.rightBarButtonItem = focusTest;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment