Kye
Kye

Reputation: 6239

How do I theme a MonoTouch application?

I'm doing an MonoTouch application and I would like to apply a theme. (So I don't have to have go around and apply a custom color and style to each view background and button.)

Is there any easy way to do this? So should I be setting the color manually, and use a helper class to determine which color?

e.g.

_myButton.Color = ThemeHelper.GetButtonColor();

Upvotes: 0

Views: 405

Answers (1)

Tron5000
Tron5000

Reputation: 854

You may want to take a look at UIAppearance in iOS 5+. It allows devs to set styles for UI elements globally as in the following example:

UIButton.Appearance.BackgroundColor = UIColor.Blue;

For more info, here's a good blog post: http://tirania.org/monomac/archive/2011/Oct-14.html

Upvotes: 1

Related Questions