IOS 5 How to change the color of back button in a navigation bar?

后端 未结 5 1387
感动是毒
感动是毒 2020-12-28 09:09

I want to change the color of back button of a navigation bar to make it look like this\"enter

5条回答
  •  無奈伤痛
    2020-12-28 09:20

    Best way I found to set it globally or locally is

        [[UIBarItem appearance] setTitleTextAttributes:
             [NSDictionary dictionaryWithObjectsAndKeys:
             [UIColor colorWithRed:220.0/255.0 green:104.0/255.0 blue:1.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:@"AmericanTypewriter" size:0.0], UITextAttributeFont, 
          nil] 
            forState:UIControlStateNormal];
    

提交回复
热议问题