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 b开发者_如何学Cutton.)
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();
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
精彩评论