开发者

How do I theme a MonoTouch application?

开发者 https://www.devze.com 2023-03-21 06:53 出处:网络
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.)

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

0

精彩评论

暂无评论...
验证码 换一张
取 消