Question

In my app I want to have an option available so that the user can alter the appearance of the app. This would simply be the visual style -- navigation bar, cell, font, and button images.

The user hits a button and then the app loads in the appropriate images or whatever.

What are the ways to approach this?

Was it helpful?

Solution

In iOS 5 and later you can use the UIAppearance class method appearance, which returns the appearance proxy for the receiver, and set it there. For instance, if you wanted to make all UIView background colors green, you would simply say:

[[UIView appearance] setBackgroundColor:[UIColor greenColor]];

This would, of course, only be good for the single user session. Once the app quit, you'd be back to white or whatever background color you set as the default.

The comment suggesting this SO question: Best way to apply a theme to an iPhone app provides a much more in-depth answer, and is probably more along the lines of what you're looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top