Change color of UINavigationBar

前端 未结 5 1001
囚心锁ツ
囚心锁ツ 2021-01-28 20:38

Hello,

I created UINavigationBar, and I try to change the color bar to aqua color (As in Nib file)

How do I do it?

5条回答
  •  一生所求
    2021-01-28 21:14

    UINavigationBar *bar = [self.navigationController navigationBar];
    [bar setTintColor:[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]];
    

    Please try above code for set color.

    Edited

     UINavigationBar *bar = [self.navigationController navigationBar];
    UIColor* aqua = [UIColor colorWithRed:0 green:1 blue:1 alpha:1];
    [bar setTintColor:aqua];
    

    This Code use for the aqua color

提交回复
热议问题