Reputation: 20670
I am developing application for iPhone and iPad both, its working fine in iPhone but for iPad it gives this full gray background color, while I want full blue background color. I am using two xib files and doing this in code. I works fine with iphone but not with ipad.
- (void)viewDidLoad {
[super viewDidLoad];
[[NSBundle mainBundle] loadNibNamed:@"LoginHeaderViewController" owner:self options:nil];
self.tableView.tableHeaderView = tableHeaderView;
[[NSBundle mainBundle] loadNibNamed:@"LoginFooterViewController" owner:self options:nil];
self.tableView.tableFooterView = tableFooterView;
self.view.backgroundColor = [UIColor colorWithRed: (66.0/255) green: (142.0/255) blue: (189.0/255) alpha: 1.0];
}
I even put these lines In above code then It gives the below pic result otherwise it show all gray background.
tableHeaderView.backgroundColor = [UIColor colorWithRed: (66.0/255) green: (142.0/255) blue: (189.0/255) alpha: 1.0];
tableFooterView.backgroundColor = [UIColor colorWithRed: (66.0/255) green: (142.0/255) blue: (189.0/255) alpha: 1.0];
Upvotes: 0
Views: 2833
Reputation: 509
[myTableView setBackgroundView:nil];
[myTableView setBackgroundView:[[[UIView alloc] init] autorelease];
This will suit your background color change
Upvotes: 0
Reputation: 1401
tableview.backgroundColor = color;
Set background view to nil using following :
tableview.backgroundView = nil;
Hope it will work
Upvotes: 0
Reputation: 14123
If you want blue background color then there is no need to assign color to tableHeader and tableFooter as the color of self.view is blue. So make the following changes:
tableHearder.backgroundColor = [UIColor clearColor];
tableHeader.backgroundView = nil;
tableFooter.backgroundColor = [UIColor clearColor];
tableFooter.backgroundView = nil;
Upvotes: 0