9

I am developing an iPad application in which I need a table view ( style grouped ) having background color as clearColor.

My problem is

[self.tableView setBackgroundColor:[UIColor clearColor]];

works well if the table view style is plain but when I switch to group table view the background color does not changes it stays gray in color.

FYI: the contentview background color of tableviewcell also does not change.

Is this a bug in iPhone-sdk or I am doing something wrong.

Madhup Singh Yadav
  • 8,077
  • 7
  • 48
  • 82

1 Answers1

26

solved:

simply do:

[self.tableView setBackgroundView:nil];

Hope this helps.

Madhup Singh Yadav
  • 8,077
  • 7
  • 48
  • 82
  • thats the correct solution.. thanks for that.. btw do you know why [self.tableView setBackgroundColor:[UIColor clearColor]]; does not work? – learner2010 Mar 22 '11 at 15:00
  • @learner2010: I think its because when we set the background color of table as clear color then the background color of the table view is changed but the view which is set as background view (of course its different from table view itself) retains its default color. – Yogi Mar 08 '13 at 04:58