Apparently, UIColor is not necessarily the only color, but it can be a template. Confusingly, this is not supported in Interface Builder.
Instead, you set the backgroundColor of the view (for example, to -viewDidLoad) using the convenience method + colorWithPatternImage: and pass it the image of the user interface. For instance:
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"gingham.png"]]; }
Of course, be sure to add the image file to your application package.
There are also some built-in background colors:
- groupTableViewBackgroundColor
- viewFlipsideBackgroundColor
Since they are used globally in all iPhone applications, you take the double-edged sword of OS updates, updating the look of your application (giving it a new look that may or may not work correctly).
For example:
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; }
Frank Schmitt Oct 22 '08 at 4:48 2008-10-22 04:48
source share