James
James

Reputation: 229

How to change color of tableview background

I am trying to figure how to change the color of the background of a plain uitableview after the using has scrolled past the top or bottom of the table. Not sure what its called but if you look at the mail app, if you scroll down, whilst already at the top of the table, the background is a dark gray color with a slight gradient. Anyone know how i go about implementing this?

Upvotes: 2

Views: 1487

Answers (2)

PJR
PJR

Reputation: 13180

tableview.backgroundColor = [UIColor clearColor]; // you can write any color in place of clear color

Upvotes: 0

visakh7
visakh7

Reputation: 26390

tableView.backgroundColor = [UIColor redColor]; 

will provide a red color background for your table view

Other options include

tableView.backgroundColor = [UIColor colorWithPatternImage:anImage];
tableView.backgroundColor = [UIColor colorWithRed: green: blue: alpha: ];
tableView.backgroundColor = [UIColor colorWithHue: saturation: brightness: alpha: ];
tableView.backgroundColor = [UIColor colorWithCGColor:cgColor];

Upvotes: 2

Related Questions