iPhone UINavigationBar change font style for all controllers with [UINavigationBar appearance]

后端 未结 3 1899
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 20:27

I\'m aware that I can individually change the font of a navigation bar as outlined in this answer: Change the navigation bar's font

Currently I\'m using a more globa

3条回答
  •  一生所求
    2021-02-09 21:09

    @Javy's answer with @Philip007's suggestion:

    [[UINavigationBar appearance] setTitleTextAttributes: @{
                                UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
                          UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
                         UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)],
                                     UITextAttributeFont: [UIFont fontWithName:@"Helvetica-Light" size:0.0f]
     }];
    

    ahh... that's better!

提交回复
热议问题