Thursday, May 2, 2013

Globally change navigation bar title color using appearance - IOS

//For Navigation BAR
  NSDictionary *text = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor GreenColor], UITextAttributeTextColor, [UIColor whiteColor], UITextAttributeTextShadowColor, nil];

    [[UINavigationBar appearance] setTitleTextAttributes:text];



//For Navigation Item


   [[UIBarButtonItem appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:1.0],
      UITextAttributeTextColor,
      [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
      UITextAttributeTextShadowColor,
      [NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
      UITextAttributeTextShadowOffset,
      [UIFont fontWithName:@"Helvatica" size:0.0],
      UITextAttributeFont,
      nil]  forState:UIControlStateNormal];