UIBarStyleBlack vs tintColor black
What is the difference between setting the tintColor property of UINavigationBar to [UIColor blackColor] and setting barStyle to UI开发者_JS百科BarStyleBlack on opaque navigation bar?
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.
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.
加载中,请稍侯......
精彩评论