Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the global tint color programmatically? [duplicate]

My project needs to switch between 2 different global tint values. How can I do this programmatically?

like image 430
jimbob Avatar asked Oct 28 '13 17:10

jimbob


2 Answers

Change the tint color of the UIWindow of the application. You can either use the [[UIApplication sharedApplication] keyWindow] but better is to use [[UIApplication sharedApplication] delegate].window.

like image 162
Léo Natan Avatar answered Oct 19 '22 06:10

Léo Natan


UIAppearance is the answer! It sets property to all the objects of that class (and subclasses).

[[UIView appearance] setTintColor:(UIColor *)]

You can change the backgroudColor of all the buttons too

[[UIButton appearance] setBackgroundColor:(UIColor *)]
like image 27
Gonzo Avatar answered Oct 19 '22 05:10

Gonzo