Madu
Madu

Reputation: 5019

BackgroundColor of UItableviewCell Notworking

I am setting the Background color of my uitableviewCell like

 cell.contentView.backgroundColor = [UIColor colorWithRed:8.0 green:210.0 blue:11.0 alpha:1.0];

its not working, however, if i do like

 cell.contentView.backgroundColor = [UIColor grayColor];

it works then. Any help

Upvotes: 0

Views: 49

Answers (1)

Alexander
Alexander

Reputation: 7238

UIColor has to be defined between 0 and 1 to get the RGB value to work (UIColor class reference):

cell.contentView.backgroundColor = [UIColor colorWithRed:8.0f/255.0f green:210.0f/255.0f blue:11.0f/255.0f alpha:1.0f];

Upvotes: 1

Related Questions