Change table view ( tableview style grouped ) background color?
Asked Answered
D

1

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.

Dactylo answered 19/3, 2010 at 10:48 Comment(0)
D
26

solved:

simply do:

[self.tableView setBackgroundView:nil];

Hope this helps.

Dactylo answered 1/4, 2010 at 5:5 Comment(2)
thats the correct solution.. thanks for that.. btw do you know why [self.tableView setBackgroundColor:[UIColor clearColor]]; does not work?Limburg
@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.Hieroglyphic

© 2022 - 2024 — McMap. All rights reserved.