Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIBarStyleBlack vs tintColor black

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

like image 877
BojanG Avatar asked May 26 '11 23:05

BojanG


2 Answers

There are a few subtle differences. For example, on iPad, you get a matte style with the tint color, but a glossy one with the barStyle.

Also, the color of bordered UIBarButtonItems is slightly different; with the black barStyle, they are gray, which makes it easier to distinguish the darker highlighted state, while with a black tint color, the buttons look almost identical in normal and highlighted state.

I think UIBarButtonItems with 'Done' style also look different, but I'm not sure about that.

like image 162
omz Avatar answered Oct 21 '22 11:10

omz


There are only 2 options for barStyle: default and black. However, you can set the tintColor to anything you like: red, blue, green, orange, some funny rgb defined color, etc. The default tintColor for UIBarStyleBlack is, not surprisingly, [UIColor blackColor].

I recommend you just play around with how they look. Set the tint to something fun and toggle between styles. See what you prefer for your app.

like image 37
PengOne Avatar answered Oct 21 '22 10:10

PengOne