Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AdityaDeshmane/90502da6c734c6361ca5 to your computer and use it in GitHub Desktop.
Save AdityaDeshmane/90502da6c734c6361ca5 to your computer and use it in GitHub Desktop.
iOS : UINavigationbar button, font and text color
UIBarButtonItem *barButtonItemCart = [[UIBarButtonItem alloc] initWithTitle:@"Cart"
style:UIBarButtonItemStylePlain
target:self
action:@selector(buttonCartPressed:)];
NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor],NSForegroundColorAttributeName,
[UIFont fontWithName:@"Avenir-Light" size:16],NSFontAttributeName,nil];
[barButtonItemCart setTitleTextAttributes:navbarTitleTextAttributes forState:UIControlStateNormal];
viewController.navigationItem.rightBarButtonItem = barButtonItemCart;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment