margusholland
margusholland

Reputation: 3348

UITableViewCell background color only working with the preset color methods

Have some very strange thing happening to me with a UITableViewCell background and was hoping if someone knows whether this is a bug.

If I set my UITableView and the UITableViewCell background colors to one of the preset color methods (whiteColor, blackColor, etc) it works fine and all the rows take the necessary color. Yet, when I use either the colorWithRed:green:blue:alpha or colorWithHue:saturation:brightness:alpha I always end up getting a white background for the table.

Is this a bug in Apple’s code or am I just missing something?

Upvotes: 0

Views: 206

Answers (1)

bigkm
bigkm

Reputation: 2277

what are you putting into red:green:....

I've seen lots of examples where they use ints or 0-255 and this isn't correct.

[UIColor colorWithRed:0.3 green:0.2 blue:0.2 alpha:1.0]

they should be in the range of 0-1

Upvotes: 3

Related Questions