Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set background color on UITableView in IOS 6 [duplicate]

Possible Duplicate:
Change background of a grouped UITableView

I am not able to change the background color of UITableView if it is UITableViewStyleGrouped. My code :

[addressNewTbl setBackgroundColor:[UIColor redColor]];

Help!

like image 895
IOS_Dev Avatar asked Sep 27 '12 09:09

IOS_Dev


2 Answers

You might need to add some code. Try -

[UITableView setBackgroundView: nil];

or you can also do :

UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor yellowColor];
[tableView setBackgroundView:bview];

Both will work..

like image 69
NiKKi Avatar answered Oct 04 '22 20:10

NiKKi


Did you try

addressNewTbl.backgroundView = nil;
[addressNewTbl setBackgroundColor:[UIColor redColor]];
like image 29
Maulik Avatar answered Oct 04 '22 22:10

Maulik