UIBarStyleBlack vs tintColor black

What is the difference between setting the tintColor property from UINavigationBar to [UIColor blackColor] and setting barStyle to UIBarStyleBlack in an opaque navigation bar?

+6
source share
2 answers

There are a few subtle differences. For example, on an iPad, you get a matte style with a touch of color, but glossy with barStyle .

Also the border color of the UIBarButtonItem slightly different; with black barStyle they are gray, which simplifies the selection of the dark highlighted state, and with the black color of the hue, the buttons look almost the same in the normal and highlighted state.

I think that a UIBarButtonItem with the "Done" style also looks different, but I'm not sure about that.

+9
source

There are only 2 options for barStyle : default and black. However, you can set tintColor to whatever you like: red, blue, green, orange, some kind of funny rgb specific color, etc. The default is tintColor for UIBarStyleBlack , which is not surprising, [UIColor blackColor] .

I recommend that you just play around with how they look. Set the hue to something fun and switch between styles. Find out what you prefer for your application.

+2
source

Source: https://habr.com/ru/post/889162/


All Articles