Get the right color in iOS7 translucent navigation bar

后端 未结 20 1225
囚心锁ツ
囚心锁ツ 2020-11-28 00:59

How can I get the right coloring for my translucent navigation bars in iOS 7? The navigation bar just adjusts the given color to a much brighter one. Changing brightness or

20条回答
  •  一向
    一向 (楼主)
    2020-11-28 01:22

    To make tint color look darker you can change the backgroundColor of the navigation bar:

    UIColor *color1 = [UIColor colorWithRed:55.0f/256.0f green:0.0f blue:1.0f alpha:1.0f];
    [navBar setBarStyle:UIBarStyleBlackTranslucent];
    [navBar setBarTintColor:color1];
    UIColor *color2 = [UIColor colorWithWhite:0 alpha:0.3];
    [navBar setBackgroundColor:color2];
    

    Try playing around with color1 and color2 to achieve the result that fits to you. Anything else would be fighting the framework.

提交回复
热议问题