Reputation: 12036
My background color is white! Why? Just start an new View-based app for iPad and set background color in viewDidLoad.
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
}
What is wrong. If I set it to redColor it works. Why?
Upvotes: 4
Views: 1630
Reputation: 274
groupTableViewBackgroundColor does not work for iPad. It is iPhone only. Instead, you can use
UIColor *clr = [UIColor colorWithRed:0.875 green:0.88 blue:0.91 alpha:1];
[[self view] setBackgroundColor:clr];
Upvotes: 0
Reputation: 94794
groupTableViewBackgroundColor
on the iPad (or at least on an iPad with iOS 4.2) is the same as clearColor
, rather than the pattern used on the iPhone. You can create a "color" with your own background pattern using UIColor's colorWithPatternImage:
method.
Upvotes: 7