If you focus only on iOS 5, I highly recommend watching Session 114 - Customizing the Appearance of UIKit Controls, you need to register a video developer for the WWDC 2011 session.
It details the App-wide style.
I want to change the idea of ββyujis: use category in UIButton to customize the button
.h.
@interface UIButton (MyStyling) -(void)configureMyButtonStyle;
.m
@implementation UIButton (MyStyling) -(void)configureMyButtonStyle { [self setBackgroundColor:[UIColor colorWithRed:β¦]]; [self setTitleColor: [UIColor colorWithRed:β¦] forState: UIControlStateNormal];
Now you can call [aButton configureMyButtonStyle]
Of course, you can also analyze some parameters to distinguish between several styles.
-(void)configureMyButtonForStyle:(NSInteger)style { if(style == 1){ //β¦ } else if(style == 2) { //.. } else { //fallback style } }
using:
[aButton configureMyButtonForStyle:1]
source share