0
votes

Is there a option to set app level tint color for all the elements (UITableView, Navigation bar) etc ?

I would like to set at app level tint color so that any new element create to by default use default tint color.

2

2 Answers

0
votes

The new appearance API in iOS 5 allows for customization at the app-wide level. If you must support older OS versions, overriding drawRect in a subclass or method swizzling was the way to go.

To access the appearance API, simply use class +appearance, like so:

[[UINavigationBar appearance]setTintColor:[UIColor myAwesomeColor]];
0
votes

In iOS 5 you can do these:

For Navigation Bar:

[[UINavigationBar appearance] setTintColor:[UIColor greenColor]];

For TabBar

[[UITabBar appearance] setTintColor:[UIColor greenColor]];

Just put these codes in applicationDidFinishLaunching:

EDIT: To make app level selection color of tableView cell, you can create a custom UITableView class.